title: Using Arrays, Loops, and conditions in C programming
body: <p>The questions that I'm trying to solve:</p>
  
  <ul>
  <li>Ask the user for five numbers and store it in an array. </li>
  <li>Determine the highest number entered and the average of the array </li>
  <li>Will be using a for loop to solve this problem.</li>
  </ul>
  
  <p>The code that I wrote to solve this problem but I don't know why it's 
  not working. Can someone please walk me through what I'm doing wrong?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
    int main()
     {
       int i, n;
       float arr[5], sum = 0, average;
  
       printf("Please enter five numbers, separated by spaces!\n");
       scanf("%d", &amp;n);
  
       //Stores numbers entered into an array
       for(i = 0; i &lt; n; i++)
       {
          printf("%d: ", i++);
          scanf("%d", &amp;arr[0]);
  
  
          for(i = 1; i &lt; n; i++)
          {
              if(arr[0] &lt; arr[i])
                  arr[0] = arr[i];
          }
          printf("The highest of the five numbers is %d\n", arr[0]);
  
          for(i = 0; i &lt; n; i++)
          {
              printf("%d. Enter number: ", i+1);
              scanf("%f", &amp;arr[i]);
              sum += arr[i];
          }
  
          average = sum / n;
          printf("The average of the five numbers is %f\n", average);
        }
      }    
  </code></pre>