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,

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

1 Expert Approved Answer
Step: 1 Unlock

Heres an example code in c include using namespace std int main int count 0 sum 0 number while count ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!