home
Learn
screen_rotation
#include <stdio.h> #include <conio.h> void main(){ int arr[2][2][3]; int i,j,k; clrscr(); printf("\n This is multidimensional array program."); for(i=0;i<2;i++){ for(j=0;j<2;j++){ for(k=0;k<3;k++){ printf("\n Enter value for arr[%d][%d][%d]: ",i,j,k); scanf("%d",&arr[i][j][k]); } } } for(i=0;i<2;i++){ for(j=0;j<2;j++){ for(k=0;k<3;k++){ printf("\n value of arr[%d][%d][%d] = %d",i,j,k,arr[i][j][k]); } } } getch(); }
Program Output
This is multidimensional array program. Enter value for arr[0][0][0]: 10 Enter value for arr[0][0][1]: 11 Enter value for arr[0][0][2]: 12 Enter value for arr[0][1][0]: 13 Enter value for arr[0][1][1]: 14 Enter value for arr[0][1][2]: 15 Enter value for arr[1][0][0]: 16 Enter value for arr[1][0][1]: 17 Enter value for arr[1][0][2]: 18 Enter value for arr[1][1][0]: 19 Enter value for arr[1][1][1]: 20 Enter value for arr[1][1][2]: 21 value of arr[0][0][0] = 10 value of arr[0][0][1] = 11 value of arr[0][0][2] = 12 value of arr[0][1][0] = 13 value of arr[0][1][1] = 14 value of arr[0][1][2] = 15 value of arr[1][0][0] = 16 value of arr[1][0][1] = 17 value of arr[1][0][2] = 18 value of arr[1][1][0] = 19 value of arr[1][1][1] = 20 value of arr[1][1][2] = 21