#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a[3][3],i,j;
printf("enter the matrix to transpose=\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{ scanf("%d",&a[i][j]);
}
for(i=0;i<3;i++)
{ for(j=0;j<3;j++)
{ printf("\t%d",a[j][i]);
}
printf("\n");
}
getch();
}
#include <conio.h>
void main()
{
clrscr();
int a[3][3],i,j;
printf("enter the matrix to transpose=\n");
for(i=0;i<3;i++)
for(j=0;j<3;j++)
{ scanf("%d",&a[i][j]);
}
for(i=0;i<3;i++)
{ for(j=0;j<3;j++)
{ printf("\t%d",a[j][i]);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment