Professional Documents
Culture Documents
2D array declaration
datatype arrayVariableName[number of rows] [number of columns]
int num[10][5];
Here is a simple program of 2D array which adds two arrays and stores the
result in another array. One array has already been initialized and the other
one will have data input by the user.
#include <stdio.h>
int main() {
// values
int a[3][3] = {
scanf("%d", &b[i][j]);
printf("\n");
return 0;
}
Output:-
Enter values in the 3x3 array:
30
4
17
6
9
14
20
0
6
31 38 22
13 9 29
43 4 12