Calculate max, min, and average Write a program to ask a user to input a set of positive integers. Your program will calculate the number of entries, the maximum, the minimum, the total of all entries and the average. Terminate the loop with a -1. Display the average as a floating-point number with no more than two decimal places. Your output might look similar to this. You can use your own text and formatting. Enter a series of integers and then display the number of entries, the largest integer, the smallest integer, the sum of all the integers, and the average. Enter -1 to terminate the series. Enter an integer (-1 to quit): 3 Enter another integer (-1 to quit): 5 Enter another integer (-1 to quit): 7 Enter another integer (-1 to quit): 2 Enter another integer (-1 to quit): -1 The number of entries you entered is 4. The greatest number you entered is 7. The least number you entered is 2. The sum of all the numbers you entered is 17. The average off all the numbers is 4.25. Process exited after 11.13 seconds with return value 0 Press any key to continue...
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
In c++ pls
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images