Preview
Multi dimensional Arrays
An array containing multiple dimensions(more than two) is known as multi-dimensional array. We can use more than two pairs of brackets to specify the size or refer any array element
Syntax :
<Type> Array_name[size1][size2][size3]……………….;
size1,size2,size3,…. specify the dimensions in the multidimensional array. They should be integer values.
Program |
#include<stdio.h> int main() { int a[2][2][2]={1,2,3,4,5,6,7,8};printf(“\n%d”,a[0][0][0]); printf(“\n%d”,a[0][0][1]); printf(“\n%d”,a[0][1][0]); printf(“\n%d”,a[0][1][1]); printf(“\n%d”,a[1][0][0]); |
Best Books of Computer Science