#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],i,j,r,c;
clrscr();
printf("\n Enter row and column number:-");
scanf("%d%d",&r,&c);
printf("\n Enter %d*%d matrix:-",r,c);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n storage representation of 2-D array:-");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\n[%d][%d]= %d",i,j,a[i][j]);
}
printf("\n");
}
getch();
}
/* OUTPUT
Enter row and column number:-3 3
Enter 3*3 matrix:-1 2 3
4 5 6
7 8 9
storage representation of 2-D array:-
[0][0]= 1
[0][1]= 2
[0][2]= 3
[1][0]= 4
[1][1]= 5
[1][2]= 6
[2][0]= 7
[2][1]= 8
[2][2]= 9
*/
#include<conio.h>
void main()
{
int a[10][10],i,j,r,c;
clrscr();
printf("\n Enter row and column number:-");
scanf("%d%d",&r,&c);
printf("\n Enter %d*%d matrix:-",r,c);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("\n storage representation of 2-D array:-");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("\n[%d][%d]= %d",i,j,a[i][j]);
}
printf("\n");
}
getch();
}
/* OUTPUT
Enter row and column number:-3 3
Enter 3*3 matrix:-1 2 3
4 5 6
7 8 9
storage representation of 2-D array:-
[0][0]= 1
[0][1]= 2
[0][2]= 3
[1][0]= 4
[1][1]= 5
[1][2]= 6
[2][0]= 7
[2][1]= 8
[2][2]= 9
*/