PROGRAM TO TRANSPOSE OF MATRIX.
Thursday, July 2, 2009
Leave a Comment
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],i,j;
clrscr();
printf("Enter the element ofmatrix a\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
//printf("\n");
}
printf("The transpose of matrix a is\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%d",a[j][i]);
}
printf("\n");
}
Getch();
}
OUTPUT
Enter the element of matrix a:
1 2 3
4 5 6
7 8 9
The transpose of matrix is:
1 4 7
2 5 8
3 6 9
0 comments »
Leave your response!