INVERSE - { temp=mat[a][b]; mat[a][b]=mat[a+1][a+1];...

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

View Full Document Right Arrow Icon
#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)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
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

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Page1 / 2

INVERSE - { temp=mat[a][b]; mat[a][b]=mat[a+1][a+1];...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online