#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],b[10][10],i,j;
clrscr();
printf("\nEnter the elements of
matrix:");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nThe Transpose of matrix
is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
b[i][j]=a[j][i];
printf("\t%d\t",b[i][j]);
}
printf("\n");
}
getch();
}
//OUTPUT:
//Enter the
elements of matrix:
1 2 3 4 5 6 7 8 9
//The Transpose
of matrix is:
1 4 7
2 5 8
3 6 9
This comment has been removed by the author.
ReplyDeleteTranspose of a matrix is similar to rotating a matrix by 90 degree. first row of matrix becomes first column and so on.
ReplyDeleteAwesome sirji awesome😊😊
ReplyDelete