C++ program to show matrix transpose

      No Comments on C++ program to show matrix transpose

Matrix transpose

This program illustrate the concept of matrix transpose.Matrix transpose means changing row into coloumns and coloumns into row.

  • Here in this program “i” is number of rows and “j” is number of coloumns.
  • a[3][3] is the name of matrix and it also repersent the size of matrix i.e. 3 X 3 means user can input maximum 3 rows and coloumns.

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int a[3][3],i,j;

 cout<<"Enter Matrix row wise:-\n";

 for(i=0;i<3;i++)
  {
   for(j=0;j<3;j++)
    {
      cin>>a[i][j];
    }
  }
  cout<<"Transpose of Matrix is:-\n";
  for(i=0;i<3;i++)
  {
   for(j=0;j<3;j++)
    {
     cout<<"\t"<<a[j][i];

    }
    cout<<"\n";
  }
 getch();
}

OUTPUT:-

Matrix transpose


Transpose matrix concept

matrix transpose


Comment below if you are facing any problem


Also read

C++ program to show addition and subtraction of two matrix
How to transpose a entered matrice in java program
C program to multiply two matrix

Leave a Reply

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