Question: Write a program in C++ which reads in numbers from the keyboard, one per line, until it gets a zero. Then print out the number

Write a program in C++ which reads in numbers from the keyboard, one per line, until it gets a zero. Then print out the number of values entered, the sum of all values, the largest number, the smallest number, and the average of all the numbers. Do not count the zero. Here is sample output from one version of the program:

 % ./stats 2 4 6 12 -9 0 # items: 5 Sum: 15 Max: 12 Min: -9 Mean: 3 %

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!