Skip to content

Commit 8857f8c

Browse files
authored
Merge pull request #2 from aripradeep/aripradeep-patch-2
Create Array in small
2 parents 3d44d19 + c746c5f commit 8857f8c

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

Array in small

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
/ Program to take 5 values from the user and store them in an array
3+
// Print the elements stored in the array
4+
#include <stdio.h>
5+
6+
int main() {
7+
int values[5];
8+
9+
printf("Enter 5 integers:\n");
10+
11+
// taking input and storing it in an array
12+
for(int i = 0; i < 5; ++i) {
13+
scanf("%d", &values[i]);
14+
15+
}
16+
17+
printf("Displaying integers:\n");
18+
19+
// printing elements of an array
20+
for(int i = 0; i < 5; ++i) {
21+
printf("%d\n", values[i]);
22+
}
23+
return 0;
24+
}

0 commit comments

Comments
 (0)