Question: C. Write C++ code for a while loop that reads positive integers and computes their sum. It stops when the sum reaches the value

C. Write C++ code for a while loop that reads positive integers 

C. Write C++ code for a while loop that reads positive integers and computes their sum. It stops when the sum reaches the value of 50 or more. Once the loop stops, the number of integers read will be displayed. For example, if the inputs are 25 3 40, then the sum is 68 and the number of integers read is 3. (6mark)

Step by Step Solution

3.34 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include iostream int main ... 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!