I have been looking for something to make it click in my head on how to get the average of my array and I need help.
#include <iostream>
#include <math.h>
using namespace std;
int grades[10],a,total;
double average;
void main(){
cout << "Enter 10 test grades to average:" <<endl <<endl;
for (a = 0; a < 10; a++){
cout << "Enter a grade: ";
cin >> grades[a];
}
while {
total = total + grades[a];
average = total/10;
cout << average <<endl;
}
char wait;
cout << "Press any key followed by enter to exit. ";
cin >> wait;
return;
}