It's pretty simple, use a for loop and divide the sum of the scores by the number of scores:
int testScores[5] = { 90, 70, 56, 88, 82 };
int sum = 0;
float average;
for (int i = 0; i %26lt; 5; i++)
sum += testScores[i];
average = (float)sum / 5.0f;
bouquet
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment