TRAN44 - if(a b<=3 temp= mat[a[3-b mat[a[3-b = mat[3-b[a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//transpose of matrix// #include<stdio.h> #include<conio.h> # #define F1 for(a=0;a<4;a++) #define F2 for(b=0;b<4;b++) # void main (void) { int mat[4][4]; int a,b,temp; clrscr(); // i/p of matrix // printf("Eneter the matrix of order 4 x 4: \n"); F1 { F2 { printf("Enter the value %d%d:\t",a+1,b+1); scanf("%d",&mat[a][b]); } } // for transpose // F1 { for(b=3;b>=0;b--)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { if(a+b<=3) { temp= mat[a][3-b]; mat[a][3-b] = mat[3-b][a]; mat[3-b][a] = temp; } } } clrscr(); printf("Transpose of matrix is:\n"); // o/p // F1 { F2 { printf(" %d\t",mat[a][b]); } printf("\n"); } for(a=1;a<=4;a++) { gotoxy(1,1+a); printf("\xb3"); gotoxy(28,1+a); printf("\xb3"); } getch(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online