+ 2

Why i am getting error in this code and stopped running while loop ?

https://code.sololearn.com/cG9VDevgx25V/?ref=app Why while loop stopped working in sololearn code playground. Look at the code ?

21st Jan 2019, 8:28 AM
Sonu Kumar
Sonu Kumar - avatar
1 Odpowiedź
0
while(number != -1){ ... } You have to input a number until you input -1. Maybe in an IDE for PC it will work, because you can input the number when it's needed. But in SL you have to input all numbers at the beginning. Input 1 10 2 --> error Input 1 10 2 -1 --> should work
21st Jan 2019, 2:12 PM
Denise Roßberg
Denise Roßberg - avatar