6 Aug 2019

  • August 06, 2019
  • Amitraj









/*   C Program to find transpose of a given matrix  */   By Amit raj purohit

http://codevidyalay.blogspot.com 


#include<stdio.h>
int main()
{
int a[9][9], i,j,m,n;

printf("Enter matrix order:");
scanf("%d%d",&m,&n);
printf("enter %d elements",m*n);

for(i=0;i<m;i++)
for(j=0;j<n;j++)

scanf("%d", &a[i][j]);
printf("Transpose of given Matrix is:\n");
for(i=0;i<n;i++)
{

for(j=0;j<m;j++)
printf("%d\t",a[j][i]);
printf("\n");
}
return 0;
}


INPUT/OUTPUT:
Enter matrix order:2 2
enter 4 elements
11 22
33 44
Transpose of given Matrix is:
11 33
22 44



Translate

Popular Posts