TRAN44 - { if(a+b<=3) { temp= mat[a][3-b];...

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&lt;=3) { temp= mat[a][3-b]; mat[a][3-b] = mat[3-b][a]; mat[3-b][a] = temp; } } } clrscr(); printf(&quot;Transpose of matrix is:\n&quot;); // o/p // F1 { F2 { printf(&quot; %d\t&quot;,mat[a][b]); } printf(&quot;\n&quot;); } for(a=1;a&lt;=4;a++) { gotoxy(1,1+a); printf(&quot;\xb3&quot;); gotoxy(28,1+a); printf(&quot;\xb3&quot;); } getch(); }...
View Full Document

Ask a homework question - tutors are online