Skip to content

Commit b6d01b9

Browse files
committed
Add program showing multi-dim array
1 parent 1fd1cb1 commit b6d01b9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

muti-dimensional-array.c

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdio.h>
2+
void print_array(int a[4][3]) {
3+
for (int i = 0; i < 4; i++)
4+
for (int j = 0; j < 3; j++)
5+
printf("position: (%d,%d) value: %d\n", i, j, a[i][j]);
6+
}
7+
int main() {
8+
int a[4][3] = {{1, 2, 3}, {5, 4, 3}, {1, 2, 8}, {4, 1, 6}};
9+
print_array(a);
10+
return 0;
11+
}

0 commit comments

Comments
 (0)