adds

Transpose of a matrix by C++ Programme:


THEORY:
If A = [aij] be an m × n matrix, then the matrix obtained by interchanging the rows and columns of A is called the transpose of A. Transpose of the matrix A is denoted by A′ or (AT ). In other words, if A = [aij]m×n , then AT = [aji] n×m .

CODING:
#include<iostream.h>
#include<conio.h>
void main()
{
int a[3][3];
int i,j;
clrscr();
cout<<"Enter the elements of the matrix:\n";
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
cin>>a[i][j];
}
}
cout<<"The matrix is :\n";
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
cout<<a[i][j]<<"\t";
}
cout<<endl;
}
cout<<"The transpose of the matrix is:\n";
for (i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
cout<<a[j][i]<<"\t";
}
cout<<endl;
}
getch();
}
OUTPUT:





Model syllabus (+3)Downoad

List of all practicals:   Download

Get all Books:  Download

                                                Get all B.Sc 
                                              Physics Notes
Syllabus For:                               CLICK

IIT-JAM       
                                                        


  • How to Prepare for IIT-JAM  ⇠ ⇠ Click Here

Post a Comment

Previous Post Next Post