/* PROGRAM TO READ AND PRINT A 3-D ARRAY */

 

#include<stdio.h>

#include<conio.h>

void main()

{

int a[2][2][2],i,j,k;

clrscr();

 

for(i=0;i<2;i++)

{

for(j=0;j<2;j++)

{

for(k=0;k<2;k++)

{

printf(“\n\t enter a[%d][%d][%d]=”,i,j,k);

scanf(“%d”,&a[i][j][k]);

}

}

}

 

for(i=0;i<2;i++)

{

for(j=0;j<2;j++)

{

for(k=0;k<2;k++)

{

printf(“\n\t a[%d][%d][%d]=%d”,i,j,k,a[i][j][k]);

}

}

}

 

getch();

 

}

149 total views, 2 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.