[圖解C] ex 6-5

// exercise 6-5: 2nd order determinant

#include <stdio.h>
#include <stdlib.h>

int main()
{
    double A[2][2];
    int i, j;
   
    for (i=0 ; i<2 ; i++){
        for (j=0 ; j<2 ; j++){
            printf("enter the A[%d][%d] is: ", i, j);
            scanf("%lf", &A[i][j]);
        }
    }
    printf("\nthe determinant is %lf\n", A[0][0]*A[1][1]-A[0][1]*A[1][0]);
   
    system("pause");
    return 0;
}