#include<stdio.h>
main()
{
int a[100][100],r,c,i,j;
printf("\nEnter row number=");
scanf("%d",&r);
printf("\nEnter column number=");
scanf("%d",&c);
printf("\nEnter the matrix elements\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nThe matrix is\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("%9d ",a[i][j]);
}
printf("\n");
}
}
main()
{
int a[100][100],r,c,i,j;
printf("\nEnter row number=");
scanf("%d",&r);
printf("\nEnter column number=");
scanf("%d",&c);
printf("\nEnter the matrix elements\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\nThe matrix is\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("%9d ",a[i][j]);
}
printf("\n");
}
}
No comments:
Post a Comment