QUESTION#5: Write a program that inputs a sequence of non-negative numbers terminated by a negative value and show the sum, average, maximum and minimum of the non-negative numbers Sample Input 10 20 30 40 50 -10 Sample Output Sum = 150 Average = 30 Maximum = 50 Minimum = 10 13 2 15 5 30 -10 Sum = 65 Average = 13 Maximum = 30 Minimum = 2 %3D

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Note: You are not allowed to use more than seven variables in your program.

QUESTION#5:
Write a program that inputs a sequence of non-negative numbers terminated by a negative value
and show the sum, average, maximum and minimum of the non-negative numbers
Sample Input
Sample Output
10 20 30 40 50 -10
Sum = 150
Average = 30
Maximum = 50
Minimum = 10
%3D
13 2 15 5 30 -10
Sum = 65
Average = 13
Maximum = 30
Minimum = 2
Transcribed Image Text:QUESTION#5: Write a program that inputs a sequence of non-negative numbers terminated by a negative value and show the sum, average, maximum and minimum of the non-negative numbers Sample Input Sample Output 10 20 30 40 50 -10 Sum = 150 Average = 30 Maximum = 50 Minimum = 10 %3D 13 2 15 5 30 -10 Sum = 65 Average = 13 Maximum = 30 Minimum = 2
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Structure chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage