#include <stdio.h>
int main()
{
int i,j,r,c;
printf(“Enter number of rows and coloumns\n”);
scanf(“%d%d”, &r, &c);
int m1[r][c];
printf(“Enter the elements of matrix:\n”);
for(i=0; i<r; i++) {
for(j=0; j<c; j++) {
scanf(“%d”,&m1[i][j]);
}
}
printf(“Entered matrices is: \n”);
for(i=0; i<r; i++) {
for(j=0; j<c;j++) {
printf(“%d “,m1[i][j]);
}
printf(“\n”);
}
return 0;
}
Leave a Reply