#include <stdio.h>
int main() {
// declare a 3x2x2 3D array with initializer list
int a[3][2][2] = {
{
{10, 20},
{30, 40},
},
{
{1, 2},
{4, 5}
},
{
{3, 5},
{7, 11}
}
};
// declare loop variable
int i, j, k;
for (i = 0; i < 3; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) {
printf("a[%d][%d][%d] = %d\n", i, j, k, a[i][j][k]);
}
}
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: