Exercise 02: Averaging Integers

Date completed: 30/05/2018

Write an application that uses a for statement to calculate the average of several integers. Assume the last value read is the sentinel 9999. For example, the sequence 10 8 11 7 9 9999 indicates that the program should calculate the average of all the values preceding 9999.

Solution

To begin, press the button: