Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Transpose a matrix

C++ Program fot the Transpose of matrix.This c++ program prints transpose of a matrix. It is obtained by interchanging rows and columns of a matrix. When we transpose a matrix then the order of matrix changes, but for a square matrix order remains same.


Source Code:-

#include<iostream.h>
#include<conio.h>


void main()
{clrscr();
 int a[10][10],b[10][10],i,j,m,n;
 cout<<"Program for Transpose of Matrix by-Tarun Rawat\n\n";
 cout<<"Enter number of row in matrix    : ";
 cin>>m;
 cout<<"Enter number of column in matrix : ";
 cin>>n;
 cout<<"\nEnter elements in an matrix : ";

 for(i=0;i<m;i++)
    {for(j=0;j<n;j++)
    {cin>>a[i][j];
    }
    }
 cout<<"\nInput matrix : \n";
  for(i=0;i<m;i++)
    {for(j=0;j<n;j++)
    {cout<<a[i][j]<<" ";
    }
     cout<<"\n";
    }

  for(i=0;i<m;i++)
    {for(j=0;j<n;j++)
    {b[i][j]=a[j][i];
    }
    }
  cout<<"\nTranspose matrix : \n";
  for(i=0;i<m;i++)
    {for(j=0;j<n;j++)
    {cout<<b[i][j]<<" ";
    }
     cout<<"\n";
    }
getch();
}

2 comments:

  1. Best casino games you can play for free - drmcd
    No 이천 출장안마 deposit casino bonuses are exactly what they sound 남양주 출장샵 like, but some you might be interested in can play at top 영천 출장샵 casino sites 파주 출장샵 with Jul 21, 2019 목포 출장안마 · Uploaded by Casino Royale

    ReplyDelete

Blogger Widgets

Find Us On Google, Just type - way2cplusplus -

If you have any questions on implementing or understanding this C++ Program , shoot me a comment and I'll be glad to help! :) :)