#include<stdio.h>
int main()
{
int r,p,q,i,j,mat1[10][10];
printf("Enter number of rows of the matrix: ");
scanf("%d",&p);
printf("Enter number of columns of the matrix: ");
scanf("%d",&q);
r=p*q;
printf("Enter %d ",r );
printf("elements of the matrix: \n");
for(i=0; i<p; i++)
for(j=0; j<q; j++)
{
scanf("%d",&mat1[i][j]);
}
printf("Elements of the matrix you have entered are: \n");
for(i=0; i<p; i++)
{
for(j=0; j<q; j++)
{
printf("%d\t",mat1[i][j]);
}
printf("\n\n");
}
return 0;
}