matrix transpose, can any plz check this program.
/*WAP to transpose of given matrix*/
#include<stdio.h>
#include<conio.h>
void main()
{
int mat[20][20]; int tmat[20][20];
int i,j,r,c;
printf("Enter the row and column size\n");
scanf("%d%d",&r,&c);
printf("Enter the array elements for %d*%d matrix\n",r,c);
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
printf("mat[%d][%d]=",i,j);
scanf("%d",mat[i][j]);
tmat[i][j]=mat[j][i] ;
}
printf("\n");
}
clrscr();
printf("Transpose of matrix is\n");
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
printf("%d\t", tmat[i][j]);
}
printf("\n");
}
getch();
}




Recent comments
11 weeks 9 hours ago
1 year 8 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 12 weeks ago
1 year 13 weeks ago
1 year 14 weeks ago
1 year 14 weeks ago
1 year 18 weeks ago
1 year 18 weeks ago