{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# INVERSE - temp=mat[a[b mat[a[b]=mat[a 1[a 1 mat[a 1[b...

This preview shows pages 1–2. Sign up to view the full content.

#include<stdio.h> #include<conio.h> # void main (void) { int mat[2][2]; int a,b,temp; float MAT; float inverse[2][2]; clrscr(); printf("Enter the matrix of order 2x2: \n"); \ for(a=0;a<2;a++) { for(b=0;b<2;b++) { printf("Enter the value %d%d ",a+1,b+1); scanf("%d",&mat[a][b]); } printf("\n"); } MAT=(mat[0][0])*(mat[1][1])-(mat[0][1])*(mat[1][0]); for(a=0;a<2;a++) { for(b=0;b<2;b++) { if(a+b==1) mat[a][b]=-mat[a][b]; if (a+b==0)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { temp=mat[a][b]; mat[a][b]=mat[a+1][a+1]; mat[a+1][b+1]=temp; } } } for(a=0;a<2;a++) { for(b=0;b<2;b++) { inverse[a][b]=(mat[a][b]/MAT); } } clrscr(); printf("Inverse of matrix is:\n"); for(a=0;a<2;a++) { for(b=0;b<2;b++) { printf(" %f",inverse[a][b]); } printf("\n"); } for(a=1;a<=2;a++) { gotoxy(1,a+1); printf("\xb3"); gotoxy(22,a+1); printf("\xb3"); } getch(); }...
View Full Document

{[ snackBarMessage ]}