Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using a while statement, that given a series of numbers as input, adds them up until the user inputs a negative number

Write a program using a while statement, that given a series of numbers as input, adds them up until the user inputs a negative number and then prints the total. Do not add the final negative number. For example, if the following numbers are input 8 3 11 -1 The output should be: 22 Snidmi: Value: 8 Value: 3 Value: 11 Value: -1 Total: 22 Value: 23 Value: 42 Value: 12 Value: -1 Total: 77 Value: 2 Value: 2 Value: 2 Value: 2 Value: -10 Total: 8 Value: -5 Total: 0 Value: 1 Value: 2 Value: 3 Value: 4 Value: 5 Value: -2 Total: 15

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

More Books

Students also viewed these Databases questions

Question

Explain the importance of HRM to all employees.

Answered: 1 week ago

Question

Discuss the relationship between a manager and an HR professional.

Answered: 1 week ago

Question

Outline demographic considerations.

Answered: 1 week ago