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