-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPS2.C
More file actions
40 lines (37 loc) · 727 Bytes
/
PS2.C
File metadata and controls
40 lines (37 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//TITLE : WAP to STORE and Print ELEMENTS IN
// 2 D NUMERIC ARRAY OF USER DEFINED SIZE (m,n) [2,2]
#include <stdio.h>
#include <conio.h>
void main()
{
int i,j;
int a[2][3];
clrscr();
// storing data in array
for (i=0;i<2;i++)
{
for (j=0;j<3;j++)
{
printf("\nEnter element for a[%d][%d]=",i,j);
scanf("%d",&a[i][j]);
}
}
// printing elements of array
for (i=0;i<2;i++)
{
for (j=0;j<3;j++)
{
printf("a[%d][%d]=%d\t",i,j,a[i][j]);
}
printf("\n");
}
for (i=0;i<2;i++)
{
for (j=0;j<3;j++)
{
printf("\t%d\t",a[i][j]);
}
printf("\n");
}
getch();
}