//Program to transpose a matrix: #include<iostream.h> #include<conio.
h> int main ( ) { clrscr( ) ; int a[20] [20], b[20] [20], I, j, m, n ; //Input rows and columns of matrix A[m] [n] . cout << \nInput matrix- A \n; for (I = 0 ; I < m ; ++i) { for (j = 0 ; j < n ; ++j) cin >> a[i] [j] ; } cout << \nMatrix-A : ; for(I = 0 ; I < m ; ++i0 { cout <<\n ;
for (j = 0 ; j < m ; ++j ) cout << << a[i] [j] ; } for (I =0 ; I < n ; ++i) { for(j = 0 ; j < m ; ++j) b[i][j] = a[j] [i]; } cout << \nTranpose of matrix is : \n ; for (I = 0 ; I < n ; ++I ) { for(j = 0 ; j < m ; ++j ) cout << \n ; } return 0 ; }