TRANSPOSE OF GIVEN MATRIX - C-Tutorial

Latest

Sunday, 16 October 2016

TRANSPOSE OF GIVEN MATRIX

/* TRANSPOSE OF GIVEN MATRIX */


#include<stdio.h>
#include<conio.h>
main()
{
int m,n,i,j,a[5][5];
clrscr();
printf("\n Enter the row and column size:");
scanf("%d%d",&m,&n);
printf("\n Enter the 'A' Matrix elements is:");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n The Transpose of given matrix is:");
for(i=0;i<n;i++)
{
printf("\n");
for(j=0;j<m;j++)
{
printf("%3d",a[j][i]);
}
}
getch();
}

No comments:

Post a Comment