What will be the output of the following program?
class ArrayOutput
{
public static void main(String s[])
{
int input[][] = {{2, 4, 0},
{5, 5, 3},
{1, 0, 0}};
System.out.println("Determinant of given matrix is : " + getDeterminant(input));
}
public static int getDeterminant(int matrix[][])
{
int result = 0;
result = (matrix[0][0] * (matrix[1][1] * matrix[2][2] - matrix[2][1] * matrix[1][2])
- matrix[1][0] * (matrix[0][1] * matrix[2][2] - matrix[2][1] * matrix[0][2])
+ matrix[2][0] * (matrix[0][1] * matrix[1][2] - matrix[1][1] * matrix[0][2]));
return result;
}
}