Question
Write a program that reads from the keyboard up to 10 numbers, using a while loop with a SENTINEL, to count and add the
Write a program that reads from the keyboard up to 10 numbers, using a while loop with a SENTINEL, to count and add the positive values and then display the results. Your program should terminate whenever it either reads 10 number or a negative number. You assume at least there is one number. Here is an example of input/output: 27-6 Number of positive numbers is : 2 The sum of the positive numbers is: 9 Here is an another example of input/output: 2 7 6 10 3959 4 2-10 Number of positive numbers is: 10 The sum of the positive numbers is: 57
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres an example code in c include using namespace std int main int count 0 sum 0 number while count ...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 StartedRecommended Textbook for
Visual C# How to Program
Authors: Paul J. Deitel, Harvey Deitel
6th edition
134601548, 134601793, 978-0134601540
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App