#include
#include
void main()
{
int a[5][5],r,c,i,j;
clrscr();
printf("\n\nENTERED THE SIZE OF ROW=");
scanf("%d",&r);
printf("\n\nENTERED THE SIZE OF COLOUMN=");
scanf("%d",&c);
printf("\n\nENTERED THE ELEMENTS IN AN 2D ARRAY=");
for(i=0;i< r;i++)
{
for(j=0;j< c;j++)
scanf("%d",&a[i][j]);
}
printf("\n\n\n");
for(i=0;i< r;i++)
{
for(j=0;j< c;j++)
{
printf("%d",a[i][j]);
printf(" ");
}
printf("\n\n");
}
getch();
}
/*--------------------------------------------------------------
OUTPUT
----------------------------------------------------------------
ENTERED THE SIZE OF ROW=3
ENTERED THE SIZE OF COLOUMN=3
ENTERED THE ELEMENTS IN AN 2D ARRAY=1 2 3
4 5 6
7 8 9
1 2 3
4 5 6
7 8 9
*/
No comments:
Post a Comment