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
Heres an example code in c include using namespace std int main int count 0 sum 0 number while count ... View full answer
Get step-by-step solutions from verified subject matter experts
