Wednesday, May 18, 2016

Transpose of Matrix in C++ | Array Programs in C++


Transpose of a MatrixTranspose of a Matrix mn to visit all the elements of matrix from start to end this is simple and tch as first program to lrn multi dimensional arrays in C++.
transpose of matrix in c++transpose of matrix in c++ programtranspose of matrices in c++transpose of a matrix in c++ 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 pointerstranspose of matrix using c++finding the transpose of a matrix in c++


Program ofTranspose of a Matrix
#include "stdafx.h"#include "iostrm"#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();}

No comments:

Post a Comment