c program to take array input from user
#include <stdio.h>
#define MAX_SIZE 100
int main() {
int arr[MAX_SIZE];
int i, n;
// Input size of the array
printf("Enter the size of the array: ");
scanf("%d", &n);
// Input elements in the array
printf("Enter elements of the array:\n");
for (i = 0; i < n; i++) {
printf("Enter element %d: ", i + 1);
scanf("%d", &arr[i]);
}
// Display the elements of the array
printf("Elements of the array are:\n");
for (i = 0; i < n; i++) {
printf("%d ", arr[i]);
}
return 0;
}