0

Java - Help me fix this code

Hey guys I was making programm for pronic numbers challenge and I am stuck. Please check my code. Check comment in code too. That else statement ruins everything. I tried without else and it worked. Maybe I am using break incorrectlyđŸ˜¶đŸ˜So pls help😅 Thanks😁 https://code.sololearn.com/c49jU1SaqjED/?ref=app

22nd Feb 2018, 4:56 PM
Sad
Sad - avatar
4 Answers
+ 1
the for loop is breaking after the first loop i.e the value of i increases only once and when the else statement executes. the break statement stop's the loop
22nd Feb 2018, 5:51 PM
Farshaad Heydari
Farshaad Heydari - avatar
+ 1
here is ur code with modifications https://code.sololearn.com/ck5lO1UwkeGb/?ref=app
22nd Feb 2018, 5:56 PM
Farshaad Heydari
Farshaad Heydari - avatar
+ 1
Thanks a lot!
22nd Feb 2018, 5:57 PM
Sad
Sad - avatar
0
Ooh thanks a lot😅
22nd Feb 2018, 5:51 PM
Sad
Sad - avatar