Program to find the transpose of m*n Matrix | C++ Programming

Program to find the transpose of m*n Matrix | C++ Programming
//Program to find the transpose of m*n Matrix
#include<iostream.h>
#include<conio.h>
 void main()
 {clrscr();
 int A[10][10],B[10][10],m,n,i,j;
 cout<<"\n  Enter The No. of rows :";
 cin>>m;
 cout<<"\n Enter The No. of columns :";
 cin>>n;
 for(i=0; i<m;i++)
 {for(j=0; j<n;j++)
 {cout<<"\n Enter A["<<i<<"]["<<j<<"] element :";
 cin>>A[i][j];
  }
 }
 cout<<"\n The Matrix is :";
 for(i=0;i<m;i++)
 {cout<<"\n";
 for(j=0;j<n;j++)
 cout<<A[i][j]<<" ";
}
 for(i=0;i<n;i++)
{for(j=0;j<m;j++)
 B[i][j]=A[j][i];
 }
 cout<<"\n The Transpose Matrix Is :";
 for(i=0;i<n;i++)
 {cout<<"\n";
 for(j=0;j<m;j++)
 cout<<B[i][j] <<"";
 }
 getch();
 }
Program to find the transpose of m*n Matrix | C++ Programming Program to find the transpose of m*n Matrix | C++ Programming Reviewed by SHERE KHOJRAHA on February 13, 2019 Rating: 5

No comments:

Powered by Blogger.