Determinant Of 3 x 3 Matrix - Java Quiz Question



Write a program to get the determinant of 3x3 matrix.

Input (Two Dimensional matrix) Output(Integer)
2  4  1
2  5  3
2  4  9
16
5  8  2
8  0  3
7  4  3
-20
-3  -1  1
5  -2  3
6  9  -5
65
1  0  0
0  1  0
0  0  1
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
}