Question
C++ ONLY Prompt the user to type in a sequence of positive integers, separate each one with a space, then type in -1 to indicate
C++ ONLY
Prompt the user to type in a sequence of positive integers, separate each one with a space, then type in -1 to indicate the end of the input. Your program must display the largest number and the sum of all numbers greater than the first number.
Sample run 1:
Please give me some positive integers, type in -1 to end input: 1 2 5 4 8 -1 The largest number: 8 Sum of all numbers greater than the first number: 19
Sample run 2:
Please give me some positive integers, type in -1 to end input: 99 45 2 10 3 31 -1 The largest number: 99 Sum of all numbers greater than the first number: 0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started