I'm writing a program that's using arrays to display a minimum value, a maximum value, and the average. In my function getNumbers, I'm allowing the user to enter values to store. How can I error check once it's been processed that way the user can't go beyond the array size.
int getNumbers(int array[ARRAY_SIZE], int minimumValue, int maximumValue, sumValue, avgValue)
{
    int i;
    printf("Enter integers to store inside the array :");
    for(i = 0; i<= ARRAY_SIZE-1; i++)
    {
        scanf("%d", &array[i]);
    }
 }
 
    