How to find transpose of a matrix in C programming?

its simple

just do this swappping

for(i=0;i<m;i++) /*A*/

for(j=0;j<i;j++) /*B*/

{

x=a[i][j];

a[i][j]=a[j][i];

a[j][i]=x;

}

I think A and B need a change :

/*Permutation : */

for ( i = 0 ; i <= lig ; i++ ) /*A*/

for ( j = 0 ; j <= i ; j++ ) /*B*/

{

int permut = MatA[i][j] ;

MatA[i][j] = MatA[j][i] ;

MatA[j][i] = permut ;

}

/*End of permutation */

printf("\nDISPLAY MATRIX : \n") ;

for ( i = 0 ; i < col ; i++ )

{

for ( j = 0 ; j < lig ; j++ )

{

printf("%d", MatA[i][j]) ;

}

printf("\n") ;

}