We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7242c6a commit 36cbc2fCopy full SHA for 36cbc2f
c-programming/arrays/a.out
16.5 KB
c-programming/arrays/two-dimension_array.c
@@ -0,0 +1,33 @@
1
+#include <stdio.h>
2
+
3
+#define ROWS 3
4
+#define COLS 8
5
6
+int main()
7
+{
8
+ int array[ROWS][COLS];
9
10
+ // Reading elements
11
+ printf("Enter elements of the array:\n");
12
+ for (int i = 0; i < ROWS; i++)
13
+ {
14
+ for (int j = 0; j < COLS; j++)
15
16
+ printf("Element [%d][%d]: ", i, j);
17
+ scanf("%d", &array[i][j]);
18
+ }
19
20
21
+ // Writing elements
22
+ printf("\nThe array elements are:\n");
23
24
25
26
27
+ printf("%d ", array[i][j]);
28
29
+ printf("\n");
30
31
32
+ return (0);
33
+}
0 commit comments