Mar-03-2021, 09:19 PM
(Mar-03-2021, 07:49 PM)deanhystad Wrote: What will data be when the user enters -1? How can you use that information to break out of the input loop?
The program should work as follows for inputs:
The user:
Type 3 and press enter.
Type 4 and press enter.
Type 7 and press enter.
Type -1 and press enter. The program starts and gives the following output:
3 4 7
The -1 is used to start the program and start creating the LinkedList. The program should not write -1 to the result.
My problem starts in the line #25 because I don't know how to write this part of the program.