14.2k views
4 votes
Write a program that inputs numbers and keeps a

running difference. When the difference is less than 0,
output the difference as well as the count of how many
numbers were entered.
Sample Run
Enter a number: 100
Enter a number: 15
Enter a number: 62
Enter a number: 25
Difference: -2
Numbers Entered: 4
Hint: If you get an EOF error while running the code
you've written, this error likely means you're asking for
too many inputs from the user.

User Ylebre
by
5.9k points

1 Answer

6 votes

I've included my code in the picture below. Best of luck.

Write a program that inputs numbers and keeps a running difference. When the difference-example-1
User Michael Stum
by
5.7k points