Question: write a java program which will keep reading in numbers until it comes to a -1. Your program should then print the number which was
write a java program which will keep reading in numbers until it comes to a -1. Your program should then print the number which was just before the -1.
e.g:
Enter numbers: 30 15 4 -6 9 -1 The penultimate number was: 9
e.g:
Enter numbers: 5 100 -1 The penultimate number was: 100
write it using java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
