home
Learn
screen_rotation
#include <stdio.h> #include <conio.h> void main(){ int arr[2][2][3] = { { {10, 20, 30}, {70, 60, 50} }, { {99, 98, 97}, {22, 33, 44} } }; 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 value of arr[%d][%d][%d] = %d",i,j,k,arr[i][j][k]); } } } getch(); }
Program Output
This is multidimensional array program. value of arr[0][0][0] = 10 value of arr[0][0][1] = 20 value of arr[0][0][2] = 30 value of arr[0][1][0] = 70 value of arr[0][1][1] = 60 value of arr[0][1][2] = 50 value of arr[1][0][0] = 99 value of arr[1][0][1] = 98 value of arr[1][0][2] = 97 value of arr[1][1][0] = 22 value of arr[1][1][1] = 33 value of arr[1][1][2] = 44