forked from TECHOUS/DSKaKhel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3DArrays.c
More file actions
34 lines (34 loc) · 715 Bytes
/
3DArrays.c
File metadata and controls
34 lines (34 loc) · 715 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
/*
*3D ARRAYS
*/
#include <stdio.h>
int main()
{
int R,C,H;
printf("Enter the rows,cols and height of the array\n");
scanf("%d %d %d",&R,&C,&H);
int arr[R][C][H];
for(register int i=0;i<R;i++)
{
for(register int j=0;j<C;j++)
{
for(register int k=0;k<H;k++)
{
scanf("%d",&arr[i][j][k]);
}
}
}
printf("Entered elments of the array\n");
for(register int i=0;i<R;i++)
{
printf("----\n");
for(register int j=0;j<C;j++)
{
for(register int k=0;k<H;k++)
{
printf("%d ",arr[i][j][k]);
}
printf("\n");
}
}
}