/*PROGRAM TO FIND TRANSPOSE OF A MATRIX*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,m,n,a[8][8];
clrscr();
printf(“Enter the order of the matrix: “);
scanf(“%d%d”,&m,&n);
printf(“\nEnter %d elements in the matrix:\n”,m*n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf(“%d”,&a[i][j]);
}
printf(“\nThe entered matrix of %d*%d order is:\n”,m,n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
printf(“%4d”,a[i][j]);
printf(“\n”);
}
printf(“Transpose of given matrix is:\n”);
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
printf(“%4d”,a[j][i]);
printf(“\n”);
}
getch();
}