//program to interchange matrix row into column
#include<stdio.h>
#include<conio.h>
void main()
{
int a[3][3],b[3][3],c[3][3],i,j,k;
printf("Enter value one bye one:");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Enter value one by one in Matrix B:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&b[i][j]);
}
}
printf("Matrix A is:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",a[i][j]);
}
printf("\n");
}
printf("Matrix B is: \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",b[i][j]);
}
printf("\n");
}
printf("Row and Column interchange of Matrix A:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",a[j][i]);
}
printf("\n");
}
printf("Row and Column interchange of Matrix B:\n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",b[j][i]);
}
printf("\n");
}
getch();
}
Tags
B.Tech