Loops-Quiz (Group B)

Write a program to average 5 numbers (int).

You program will need to:
– initialise summing variable

– loop to read in the 5 numbers. As part of the loop:
– prompt and obtain integers from the user
– add the integers to a summing variable

– calculate the average
– print result as follows: “Average of the five numbers is ”

You code must:
– compile and run (no errors)
– printing on screen look ‘neat’
– code is properly formatted
– comments added

Scroll to Top