/* This is the java program to find the inverse of square invertible matrix. The matrix is invertible if its determinant is non zero. */ //This is sample program to find the inverse of a matrix import java.util.Scanner; public class Inverse { public static void main(String argv[]) { Scanner input = new Scanner(System.in); System.out.println("Enter the dimension of square matrix: "); int n = input.nextInt(); double a[][]= new double[n][n]; System.out.println("Enter the elements of matrix: "); for(int i=0; i=0; --j) { x[j][i] = b[index[j]][i]; for (int k=j+1; k c1) c1 = c0; } c[i] = c1; } // Search the pivoting element from each column int k = 0; for (int j=0; j pi1) { pi1 = pi0; k = i; } } // Interchange rows according to the pivoting order int itmp = index[j]; index[j] = index[k]; index[k] = itmp; for (int i=j+1; i