Page 1 sur 9. MATRIX DETERMINANTS. 2- The matrix determinant. 11- Determinants of square matrices of dimensions 4x4 and greater.
C program tocalculate determinant of a matrix
int main(){
int determinant=0;
printf('Enter the 9 elements of matrix: ');
for(j=0;j<3;j++)
for(i=0;i<3;i++){
for(j=0;j<3;j++)
}
for(i=0;i<3;i++)
determinant = determinant +(a[0][i]*(a[1][(i+1)%3]*a[2][(i+2)%3] - a[1][(i+2)%3]*a[2][(i+1)%3]));
printf('nDeterminant of matrix is: %d',determinant);
return 0;
C code for Determinantof 2X2 matrix:
#include<stdio.h>
int a[2][2],i,j;
for(i=0;i<2;i++)
scanf('%d',&a[i][j]);
printf('nThe matrix isn');
printf('n');
printf('%dt',a[i][j]);
printf('nDeterminant of 2X2 matrix: %ld',determinant);
return 0;
8
9
The matrix is
4 8
#include<stdio.h>
int a[3][3],i,j;
for(i=0;i<3;i++)
scanf('%d',&a[i][j]);
printf('nThe matrix isn');
printf('n');
printf('%dt',a[i][j]);
determinant = a[0][0]*((a[1][1]*a[2][2]) - (a[2][1]*a[1][2]))-a[0][1]*(a[1][0]*a[2][2] - a[2][0]*a[1][2]) + a[0][2]*(a[1][0]*a[2][1] -a[2][0]*a[1][1]);
printf('nDeterminant of 3X3 matrix: %ld',determinant);
return 0;
Enter the 9 elements of matrix: 1
3
5
7
9
The matrix is
1 2 3
7 8 9
Determinant of 3X3 matrix: 0
Alogrithm:
Determinant is possible only for squarematrixes i.e. n by n matrixes.
Determinantof 3 by 3 matrix:
Determinant of matrix has defined as:a00(a11*a22 – a21*a12) + a01(a10*a22 – a20*a12) + a02(a10*a21 – a20*a11)
5. Write a c program to find out transport of a matrix.
6. Write a c program for scalar multiplication of matrix.
7. C program to find inverse of a matrix
8. Lower triangular matrix in c
9. Upper triangular matrix in c
10. Strassen's matrix multiplication program in c
11. C program to find determinant of a matrix
12. Big list of c program examples
6. Write a c program for scalar multiplication of matrix.
7. C program to find inverse of a matrix
8. Lower triangular matrix in c
9. Upper triangular matrix in c
10. Strassen's matrix multiplication program in c
11. C program to find determinant of a matrix
12. Big list of c program examples