Exception in thread "main" java.util.NoSuchElementException ERROR JAVA CODE | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Exception in thread "main" java.util.NoSuchElementException ERROR JAVA CODE

I'm a new Java learner and I have this problem in my program. I google it but I didn't find the solution. I tried it on my Notepad and CMD and it works perfectly. Idk why it doesn't work here. https://code.sololearn.com/c9r12ZQAy3Lb/#java Thanks everyone.

3rd Nov 2020, 6:09 PM
spetz141
spetz141 - avatar
4 Answers
+ 3
It works here in code playground in condition that you enter the two numbers at once separated by space and dont wait for the second prompt .
3rd Nov 2020, 9:39 PM
HBhZ_C
HBhZ_C - avatar
+ 2
try this input as one line 10 5 //res = result % y; res = x % y;
3rd Nov 2020, 9:45 PM
zemiak
+ 1
sp3tz141, it works normally, maybe the problem comes from that the input should be entered all at once, not like in your IDE on your PC.
3rd Nov 2020, 6:56 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
And how do I enter two inputs in one line?
3rd Nov 2020, 10:11 PM
spetz141
spetz141 - avatar