// C program to Get value for
// a multi-dimensional array
#include <stdio.h>
// Driver code
int main()
{
// integers array with 3 rows and 4 columns
int arr1[3][4] = { { 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 } };
// brackets is not mandatory except the edges
int arr2[3][4]
= { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
printf("Printing the value of the array 1 \n");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
printf("%d ", arr1[i][j]);
}
printf("\n");
}
printf("----------\n");
printf("Printing the value of the array 2 \n");
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 4; j++) {
printf("%d ", arr2[i][j]);
}
printf("\n");
}
}