4. Write a program that keeps asking for a number until the user inputs a negative number. Once a negative number is ent

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

4. Write a program that keeps asking for a number until the user inputs a negative number. Once a negative number is ent

Post by answerhappygod »

4 Write A Program That Keeps Asking For A Number Until The User Inputs A Negative Number Once A Negative Number Is Ent 1
4 Write A Program That Keeps Asking For A Number Until The User Inputs A Negative Number Once A Negative Number Is Ent 1 (32.3 KiB) Viewed 40 times
4. Write a program that keeps asking for a number until the user inputs a negative number. Once a negative number is entered, print out the sum of all the positive numbers they had inputted. **Hint: Use input() to prompt the user for a number and cast their answer to an int. **Hint: Define a variable outside your loop to represent the sum of all the entered numbers.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply