Answer to Question #57079 in C++ for yaseen
several integers. Assume the last value read with scanf is the sentinel 9999. A typical input sequence
10 8 11 7 9 9999
indicating that the average of all the values preceding 9999 is to be calculated.
Declare a as integer
Declare sum as real
Declare avg as real
Declare n as integer
Print ‘Input set of numbers, 9999 for end of sequence ’
if a≠9999 then
if n≠0 then
Print ‘Average is ’, avg
Print ‘Sequence is empty’
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!