- Joined
- Mar 12, 2018
- Posts
- 280
- Reaction
- 217
- Points
- 212
- Age
- 19
Up Until Zero (or less)
Ask the user to input an integer remaining_value.
While the value of remaining_value is greater than 0, continuously ask the user for an integer input named,subtrahend, and subtract this to the remaining_value.
Print the remaining_valueusing this format: {remaining_value} - {subtrahend} = {new_remaining_value}
Sample Output 1
Enter a value: 10
Enter subtrahend: 5
10 - 5 = 5
Enter subtrahend: 2
5 - 2 = 3
Enter subtrahend: 3
3 - 3 = 0
Sample Output 2
Enter a value: 15
Enter subtrahend: 15
15 - 15 = 0
Sample Output 3
Enter a value: 6
Enter subtrahend: 0
6 - 0 = 6
Enter subtrahend: 5
6 - 5 = 1
Enter subtrahend: 0
1 - 0 = 1
Enter subtrahend: 3
1 - 3 = -2