|
|
for( i = 0; i < n; ++i )
and start thinking about the while
that goes in its place. Declare the variable that increments above the while
, keep the same true condition as in the for
loop, and increment the variable at the end of the while
body.
|
|
|
|
|
|
|
|
|
|
Enter the grades (-1 to QUIT): 1. Enter grade: 2 2. Enter grade: 5 3. Enter grade: 5 4. Enter grade: 4 5. Enter grade: 8 6. Enter grade: 9 7. Enter grade: 2 8. Enter grade: 2 9. Enter grade: -1 Number of grades: 8 Average: 4 |
make a program that can calculate the total average of the amount of grades |