Mar-03-2021, 09:54 PM
You are obviously incorrect in your assessment since the code starting at line #25 is nearly correct. You just need to figure out how to exit the loop when -1 is entered (data == -1). This is an easy problem to solve, so if you are finding it difficult it likely means you are approaching the problem the wrong way. Maybe you should do some research on different ways to end a loop.