Program to find transpose of a matrix by using multi-dimensional arrays.

Find Transpose of a Matrix by Using Multi-dimensional Arrays

Program to find transpose of a matrix by using multi-dimensional arrays.

Object: Write a C++ program to find transpose of a matrix by using multi-dimensional arrays. C++ Projects

Code:

#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int mat[4][5],i,j;
cout<<“Enter matrix values:\n”;
for(i=0;i<4;i++)
{
for(j=0;j<5;j++)
{
cin>>mat[i][j];
}
}
cout<<endl;
for(i=0;i<4;i++)
{
cout<<“[ “;
for(j=0;j<5;j++)
{
cout<<mat[i][j]<<” “;
}
cout<<“]”<<endl;
}
cout<<” \nTranspose of the matrix is:\n”;
for(i=0;i<5;i++)
{
cout<<“[ “;
for(j=0;j<4;j++)
{
cout<<mat[j][i]<<” “;
}
cout<<“]”<<endl;
}
getch();
}

Output:

Program to find transpose of a matrix by using multi-dimensional arrays.

C++ projects for beginners with source code

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *