# C program to find the transpose of a given Matrix.

Write a C program to read A (MxN), find the transpose of a given matrix and output both the input matrix and the transposed matrix.
Transpose of a matrix is the interchanging the rows and columns, If A is matrix of order(i*j), where i is the row and j is the column, then Transpose of A is A(j*i). Read more about C Programming Language .

`/************************************************************ You can use all the programs on  www.c-program-example.com* for personal and learning purposes. For permissions to use the* programs for commercial purposes,* contact [email protected]* To find more C programs, do visit www.c-program-example.com* and browse!* *                                  Happy Coding***********************************************************/    */#include <stdio.h>#include <conio.h>void main(){ int i,j,M,N; int A, B; int transpose(int A[], int r, int c);  /*Function prototype*/ clrscr(); printf("Enter the order of matrix An"); scanf("%d %d", &M, &N); printf("Enter the elements of matrixn"); for(i=0;i<M;i++) {  for(j=0;j<N;j++)  {   scanf("%d",&A[i][j]);  } } printf("Matrix A isn"); for(i=0;i<M;i++) {  for(j=0;j<N;j++)  {   printf("%3d",A[i][j]);  }  printf("n"); } /* Finding Transpose of matrix*/ for(i=0;i<M;i++) {  for(j=0;j<N;j++)  {   B[i][j] =  A[j][i];  } } printf("Its Transpose isn"); for(i=0;i<M;i++) {  for(j=0;j<N;j++)  {   printf("%3d",B[i][j]);  }  printf("n"); }}  /*End of main()*/`
`Read more Similar C ProgramsMatrix ProgramsLearn C Programming`

You can easily select the code by double clicking on the code area above.