Transpose of Matrix in C++
Transpose of a Matrix
Transpose of a Matrix mean to visit all the elements of matrix from start to end this is simple and teach as first program to learn multi dimensional arrays in C++. 

transpose of matrix in c++
 transpose of matrix in c++ program
 transpose of matrices in c++
 transpose of a matrix in c++ code
 transpose of a 3x3 matrix in c++
 transpose of a sparse matrix in c++
 transpose of 3*3 matrix in c++
 transpose a matrix in c++ using pointers
 transpose of matrix using c++
 finding the transpose of a matrix in c++



Program of Transpose of a Matrix


#include "stdafx.h"
#include "iostream"
#include "conio.h"
using namespace std;

void main()
{

int m1[10][10],tm1[10][10];
int r,c;

cout<<"enter no of rows and colums of matrix=";
cin>>r>>c;
cout<<"enter the elements of matrix m1="<<endl;
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
cin>>m1[i][j];

}
cout<<endl<<"the matrix is"<<endl;
for(int i=0;i<r;i++)
{cout<<endl;
for(int j=0;j<c;j++)
{
cout<<m1[i][j]<<"\t";
}
}
cout<<endl<<"the transpose of the matrix is"<<endl;


for(int i=0;i<r;i++)
{ cout<<endl;
for(int j=0 ;j<c;j++)
{
tm1[i][j]=m1[j][i];
cout<<tm1[i][j]<<"\t";
}


}


getch();
}

0 comments:

Post a Comment

 
Top