Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads from the keyboard up to 10 numbers, using a while loop with a SENTINEL, to count and add the

image text in transcribed

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended 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