108k views
2 votes
Write a program that uses a loop with a sentinel value to find the sum of the values input. Prompt the user to input the values until a sentinel value of -999 is input. After the sentinel value is input, output the sum. Input the following numbers 21, -147, 77, 81, 1002, -23 and -999.

User Jyothu
by
5.9k points

1 Answer

3 votes

In python, your code should be:

Write a program that uses a loop with a sentinel value to find the sum of the values-example-1
User Keiko
by
6.3k points