Write a program in C++ that reads numbers from the input stream until a zero is encountered

computer science

Description

Write a program for the lab written problem written below. We are working with FOR loops and Nested loops in this segment and this. 

Write a program in C++ that reads numbers from the input stream until a zero is encountered. Display the average (rounded down to an integer), the maximum number and the minimum number. Assume that numbers entered will be between 1 and 1000.

For example

:Enter a number: 33

Enter a number: 88

Enter a number: 77

Enter a number: 22

Enter a number: 66

Enter a number: 55

Enter a number: 0

Average: 56

Max: 88

Min: 22

Another example:

Enter a number: 0 No data, so no answers!


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.