title: algorithm for finding highest score using array and output the index of that (highest score)
body: <p>so i have this program which supposed to asks 5 users of students in a 50 items quiz using array. it must output the average score and highest score of the quiz, also it must show the index at which that element(highest score) was found. so far i have sorted out how to find the average and i also have the solve codes for the highest but it gives me the wrong output.. here is my progress so far.</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  
  int main()
  {
    clrscr();
    const int input = 5;
    int student[input];
    int sum=0;
    int ave=0;
  
    cout&lt;&lt;"Please enter the score of "&lt;&lt;input&lt;&lt;" student\n";
  
    for(int i=0; i&lt;input; i++)
    {
  
      cout&lt;&lt;"student "&lt;&lt;i+1&lt;&lt;":";
      cin&gt;&gt;student[i];
      sum+=student[i];
  
      ave= sum/input;
  
    }
      int highest=1;
      int a=student[0];
      for(i=1; i&lt;a; i++)
        {
         if(student[i]&lt;highest)
         highest=student[i];
  
        }
  
      cout&lt;&lt;"Average score of the student is "&lt;&lt;ave&lt;&lt;"."&lt;&lt;endl;
      cout&lt;&lt;"Highest score is "&lt;&lt;highest&lt;&lt;"."&lt;&lt;endl;
  
     getch();
     return 0;
  }
  </code></pre>
  
  <p>can anyone tell me where is my mistakes here? i've been solving this program since last night... :(</p>