Saturday 13 December 2014

wap to implement transpose of matrix

wap to implement transpose of matrix

#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],i,j,m,n;
clrscr();
printf("enter the elements of matrix A\n");
{
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
scanf("%d",&a[i][j]);
b[j][i]=a[i][j];
}
}
}
printf("\n transepose of matrix A is \n");
for(i=0;i<=2;i++)
{
for(j=0;j<=2;j++)
{
  printf("\t %d",b[i][j]);
}
printf("\n");
}
getch();
}

No comments:

Post a Comment