Determinant Of 2x2 Matrix - Java Quiz Question


Write a program to get the determinant of 2 x 2 matrix.

Input (Two Dimensional matrix) Output (Integer)
5   8
8   0
-64
-3   -1
5   -2
11
1   0
0   1
1
-11 -22
-13 -19
-77
20  45
2   5
10



class FindTheDeterminantOf2X2Matrix
{
    public static void main(String s[])
    {
        int input[][] = {{20, 45}, {2, 5}};
        System.out.println("Determinant of 2 x 2 matrix is : " + getTheDeterminant(input));

    }


    public static int getTheDeterminant(int matrix[][]) {
    int result = 0;
    return result;
    }

}