Question: Write a loop that reads numbers from the user and sum them. The loop continues till a negative number is entered. Your program then prints

Write a loop that reads numbers from the user and sum them.Write a loop that reads numbers from the user and sum them. The loop continues till a negative number is entered. Your program then prints the result. The following are sample runs of the program.

Exercise # 2: Write a loop that reads numbers from the user and sum them. The loop continues till a negative number is entered. Your program then prints the result The following are sample runs of the program. Sample run 1: Enter a positive number: (or a negative value to finish):5 Enter a positive number: (or a negative value to finish):2 Enter a positive number: (or a negative value to finish):4 Enter a positive number: (or a negative value to finish):-5 Sum = 11.0 Sample run 2: Enter a positive number: (or a negative value to finish):-8 No positive number was entered

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!