Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Array in small
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

/ Program to take 5 values from the user and store them in an array
// Print the elements stored in the array
#include <stdio.h>

int main() {
int values[5];

printf("Enter 5 integers:\n");

// taking input and storing it in an array
for(int i = 0; i < 5; ++i) {
scanf("%d", &values[i]);

}

printf("Displaying integers:\n");

// printing elements of an array
for(int i = 0; i < 5; ++i) {
printf("%d\n", values[i]);
}
return 0;
}