0
I cant get my while loop to work
I tried while loops and for loops and do-while loops, but I can't get it to only run once when I give the right answer or stop if it goes into the while loop it does not leave ever! My code - https://code.sololearn.com/cugyApE9Niqv/#java
2 Réponses
+ 3
Get all input inside of the loop. Break from the loop only then the input is valid. To check the input for validity, remember to use equals() for all string comparisons.
https://code.sololearn.com/ca1F4UVL7g6y/?ref=app
0
Thank you