Transpose of a Matrix is one of the operations performed on Matrices wherein the transpose of a matrix A is a matrix formed from A by interchanging the rows and columns such that row i of matrix A becomes column i of the transposed matrix.
[sourcecode language='c']
//Transpose of a matrix
#include
void main()
{
int a[3][3], t[3][3],i,j;
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf(“Enter the values FOR %d row & %d column: “, i+1,j+1);
scanf(“%d”, &a[i][j]);
}
}
printf(“\n\n Entered Matrix \n”);
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf(“\t %d”, a[i][j]);
}
printf(“\n”);
}
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
t[i][j]=a[j][i];
}
printf(“\n\n Transposed Matrix \n”);
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf(“\t %d”, t[i][j]);
}
printf(“\n”);
}
}
[/sourcecode]






