#include<stdio.h>
int main()
{
int array[100][100];/// declare a 2D Array.
int i,j,r,c;
printf("
Please Enter The Row Number:");
scanf("%d",&r);
printf("
Please Enter The Column Number:");
scanf("%d",&c);
printf("
Please Enter %d X %d Element Of the array:
",r,c);
for(i=0; i<r; i++) ///scan array element
{
for(j=0; j<c; j++)
{
scanf("%d",&array[i][j]);
}
}
printf("The Element of the array:
");
for(i=0; i<r; i++)
{
for(j=0; j<c; j++)
{
printf("%d ",array[i][j]);
}
printf("
");
}
return 0;
}
Output
Please Enter The Row Number: 3
Please Enter The Column Number: 3
Please Enter 3 X 3 Element Of the array:
1 2 3
4 5 6
7 8 9
The Element of the array:
1 2 3
4 5 6
7 8 9
Add your comment