#include<stdio.h>
#include<conio.h>
void main()
{
int mat1[2][2],i,j,temp;
printf("Enter the matrix:");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("Result of matrix:\n");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
printf("%d ",mat1[j][i]);
}
printf("\n");
}
getch();
}
#include<conio.h>
void main()
{
int mat1[2][2],i,j,temp;
printf("Enter the matrix:");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&mat1[i][j]);
}
}
printf("Result of matrix:\n");
for(i=0;i<2;i++)
{
for(j=0;j<2;j++)
{
printf("%d ",mat1[j][i]);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment