Log in to add a comment

Log in to add a comment

int main ( )

{

int a [2] [2], i, j ;

long determinant ;

printf("Enter the 4 elements of matrix:");

for(i=0;i<2;i++)

for(j=0;j<2;j++)

scanf("%d", &a[i][j]);

printf("\n The matrix is\n");

for(i=0;i<2;i++)

{

printf("\n");

for(j=0;j<2;j++)

printf("%d\t",a[i][j]);

}

determinant = a [0] [0] * a[1] [1]- a [1] [0] * a [0] [1];

printf( "\n Determinant of 2×2 matrix: %1d",determinant);

return 0;

}

output :

Enter the 4 elements of matrix: 4

8

3

9

The matrix is

4 8

3 9

Determinant of 2×2 matrix:12.