#include<stdio.h>
int main()
{
int a[5][5],b[5][5],r1,c1;
printf("Enter number of rows and columns: ");
scanf("%d%d",&r1,&c1);
printf("Enter the values of the matrix: ");
for(int i=0;i<r1;i++);
{
for(int j=0;j<c1;j++)
scanf("%d",&a[i][j]);
}
printf("\nThe matrix is:\n");
for(int i=0;i<r1;i++);
{
for(int j=0;j<c1;j++)
printf("%d\t", a[i][j]);
printf("\n");
}
}
Note that the program isnt fully completed and that the program does work if i declare them outside both the loops.
Program is written in C language.