/* Matrix transpose - Program to find transpose of a matrix m*n using functions to 1) Read elements of matrix 2) find transpose 3) Display elements of matrix 4) find transpose using single matrix. May 2013 */ #include #include void read(int x[ ][10], int nr, int nc) ; void transpose(int x[ ][10], int y[ ][10], int nr, int nc) ; void show(int y[ ][10], int nr, int nc) ; void singletranspose(int x[ ][10], int nr, int nc) ; void main() { int x[10][10], y[10][10], m, n ; clrscr(); printf("Enter the number of rows and columns: "); scanf("%d %d", &m, &n) ; printf("Enter elements of the matrix row-wise:\n") ; read(x, m, n) ; transpose(x, y, m, n) ; printf("Transpose of given matrix is:\n") ; show(y,n,m) ; if(m==n) { singletranspose(x,m,n); printf("Transpose using single matrix is:\n"); show(x,n,m); } else printf("The matrix is not a square matrix"); getch(); } void read(int x[ ][10], int nr, int nc) { int r, c ; for(r=0 ; r