Answer :
#include<stdio.h>
int main ()
{
int a,b,r,s;
int c[100][100];
printf("Enter the number of row of the matrix : ");
scanf("%d",&a);
printf("Enter the number of the column : ");
scanf("%d",&b);
for (r=1;r<=a;r++)
{
for (s=1;s<=b;s++)
{
printf("Enter the elements of the Matrix %d%d : ",r,s);
scanf("%d",&c[r][s]);
}
}
printf("The Enter matrix is \n");
for (r=1;r<=a;r++)
{
for (s=1;s<=b;s++)
{
printf("%d ",c[r][s]);
}
printf("\n");
}
printf ("The transpose of matrix is : \n");
for (r=1;r<=b;r++)
{
for (s=1;s<=a;s++)
{
printf("%d ",c[s][r]);
}
printf("\n");
}
}
Output :
0 Comments