Saturday, October 22, 2011

solution of balagurusamy of chapter 7.13

#include<stdio.h>
main()
{
int a[10][10],i,j,r,c;
printf("Enter the row number: ");
scanf("%d",&r);
printf("Enter the coloumn number: ");
scanf("%d",&c);
printf("Enter Matrix:\n");
for(i=1;i<=r;++i)
{
 for(j=1;j<=c;++j)
 {
 printf("%d %d= ",i,j);
 scanf("%d",&a[i][j]);
 }
}
printf("Transpose of the Matrix:\n");
for(j=1;j<=c;++j)
{
 for(i=1;i<=r;++i)
 {
 printf("%d ",a[i][j]);
 }
 printf("\n");
}
return 0;
}

No comments:

Post a Comment