inputting an array in c
#include <stdio.h>
int main() {
// Declare an array of integers with a fixed size of 5
int arr[5];
// Use a loop to take input for each element of the array
for (int i = 0; i < 5; i++) {
// Prompt the user for input
printf("Enter element %d: ", i + 1);
// Read input and store it in the current element of the array
scanf("%d", &arr[i]);
}
// Display the entered elements of the array
printf("Entered elements of the array: ");
for (int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
return 0;
}