title: C programming Finding min, max, and average
body: <p>OK, I edited my program ***I am sorry if this is not formatted correctly (I don't know how to do that to make it easier to read for everyone :( I went through and fixed everything I could, but its still giving me errors. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define Max 1
  #define Min 0
  
  int getValidInteger(char promptString[], char errorString[], int lowerBound,
          int upperBound);
  float averageIntegerArray(int height[], int count);
  
  float printIntegerArray(char heading[], int values[], int count);
  int findExtremeInIntegerArray(int minOrMax, int values[], int count);
  
  //Get user input
  int main(int argc, char** argv) {
  
  //Get the number of scores
    int n = getValidInteger("Welcome to the Statisticamator! \n"
            "How many heights would you like to enter (1-100)?",
            "Number of scores must be 1 or higher\n", 1, 100);
    printf("N is %d\n", n);
  
  //Read in information from the user
    int height[n];
    for (int i = 0; i &lt; n; i++) {
      height[i] = getValidInteger("Enter height (0 to 100):",
              "Height must be between 0 and 100", 0, 100);
    }
  
  //Prints average heights 
    printf("\n");
    printf("Average Height: %.2f inches\n", averageIntegerArray(height, n));
  
  //prints minimum and maximum
    int min = findExtremeInIntegerArray(Min, values, n);    //ISSUE HERE TOO 
    printf("Minimum value is: %d\n", min);
  
    int max = findExtremeInIntegerArray(Max, values, n);
    printf("Maximum value is: %d\n", max);
  
    return (EXIT_SUCCESS);
  
  }
  
  //Average height in array
  float averageIntegerArray(int height[], int count) {
    int sum = 0;
    for (int i = 0; i &lt; count; i++) {
      sum += height[i];
    }
    return (float) sum / count;
  }
  
  //Get integer input from user
  int getValidInteger(char promptString[], char errorString[], int lowerBound,
          int upperBound) {
    int input;
  
  //Prompt user for input
    printf(promptString);
    scanf("%d", &amp;input);
  
  //Validate input
  
    while (input &lt; lowerBound || input &gt; upperBound) {
      printf("errorString");
      printf("\n");
      printf("promptString");
      scanf("%d", &amp;input);
    }
  
    return input;
  
  }
  //Min and Max values
  int findExtremeInIntegerArray(int minOrMax, int values[], int count);
  
    int Extreme = values[0];
  
    for (int i = 0; i &lt; count; i++)         //THIS IS WHERE IM HAVING 1 ISSUE
            {
      if ((values[i] &lt; Extreme &amp;&amp; minOrMax == Min) || (values[i] &gt; Extreme &amp;&amp; `enter code here`minOrMax == Max)) {
        Extreme = values[i];
      }
  
    }
    return (Extreme);
  }
  </code></pre>