Skip to content

Commit 36cbc2f

Browse files
committed
Add Read and Write implementation in c language
1 parent 7242c6a commit 36cbc2f

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

c-programming/arrays/a.out

16.5 KB
Binary file not shown.
+33
Original file line numberDiff line numberDiff line change
@@ -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+
for (int i = 0; i < ROWS; i++)
24+
{
25+
for (int j = 0; j < COLS; j++)
26+
{
27+
printf("%d ", array[i][j]);
28+
}
29+
printf("\n");
30+
}
31+
32+
return (0);
33+
}

0 commit comments

Comments
 (0)