Write a fragment of code that reads in integers from standard input, until end-of-file and sends their (floating point) average to standard output. If no numbers are input, the message “no values to average” is printed instead (while loops, end-of-file processing, mixed-mode arithmetic, basic conditional)

LANGUAGE: C++

CHALLENGE:

Write a fragment of code that reads in integers from standard input, until end-of-file and sends their (floating point) average to standard output. If no numbers are input, the message “no values to average” is printed instead (while loops, end-of-file processing, mixed-mode arithmetic, basic conditional).

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.