Write a program to get the determinant of 3x3 matrix.
Input (Two Dimensional matrix) | Output(Integer) |
---|---|
2 4 1 |
16 |
5 8 2 |
-20 |
-3 -1 1 |
65 |
1 0 0 |
1 |
class FindTheDeterminantOf3X3Matrix
{ public static void main(String s[])
{
int input[][] = {{2, 4, 1}, {2, 5, 3}, {2, 4, 9}};
System.out.println("Determinant of given matrix is : " + getDeterminant(input));
}
public static int getDeterminant(int matrix[][]) {
int result = 0;
//Write code here to get the determinant of given 3X3 matrix.
return result;
}
//Write additional methods here if required
}
Topic: Learn Arrays And Loops