Write a program, that takes 12-Elements in Two-Dimensional-Array that has 3 rows & 4 columns, then Transpose of that Matrix & Display it.
#include <iostream>
using namespace std;
int main()
{
int a[3][4],trans[4][3],i,j;
cout<<endl<<"Enter elements of matrix: "<<endl;
for(i=0; i<3; i++)
{
for(j=0; j<4; j++)
{
cin>>a[i][j];
}
}
cout<<endl<<"Entered Matrix: "<<endl;
for(i=0; i<3; i++)
{
for(j=0; j<4; j++)
{
cout<<a[i][j]<<"\t";
}
cout<<endl;
}
cout << endl << "Transpose of Matrix: " << endl;
for(i=0; i<4; i++)
{
for(j=0; j<3; j++)
{
cout<<a[j][i]<<"\t";
}
cout<<endl;
}
}
Monday, 1 January 2018
Write a program, that takes 12-Elements in Two-Dimensional-Array that has 3 rows & 4 columns, then Transpose of that Matrix & Display it.
Subscribe to:
Post Comments (Atom)
Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix.
Write a program, that takes 16-Elements in Two-Dimensional-Array that has 4 rows & 4 columns, then display the diagonal of Matrix. ...
0 on: "Write a program, that takes 12-Elements in Two-Dimensional-Array that has 3 rows & 4 columns, then Transpose of that Matrix & Display it."