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."); arr[0][0][0] = 101; arr[0][0][1] = 201; arr[0][0][2] = 301; arr[0][1][0] = 401; arr[0][1][1] = 502; arr[0][1][2] = 601; arr[1][0][0] = 701; arr[1][0][1] = 801; arr[1][0][2] = 901; arr[1][1][0] = 111; arr[1][1][1] = 121; arr[1][1][2] = 551; 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] = 101 value of arr[0][0][1] = 201 value of arr[0][0][2] = 301 value of arr[0][1][0] = 401 value of arr[0][1][1] = 502 value of arr[0][1][2] = 601 value of arr[1][0][0] = 701 value of arr[1][0][1] = 801 value of arr[1][0][2] = 901 value of arr[1][1][0] = 111 value of arr[1][1][1] = 121 value of arr[1][1][2] = 551