What is the fault in the loop for which the program isn't running? TIA for helping me out ️😅 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the fault in the loop for which the program isn't running? TIA for helping me out ️😅

https://code.sololearn.com/cO6zbR2DfAMY/?ref=app

19th Apr 2020, 3:33 PM
Raiyan
Raiyan - avatar
2 Answers
0
The curly bracket in line 12 closes the while loop. So all of your if statements are not part of the loop, that's why the break statement causes an error message. Line 24 closes the last elss statement. So put the bracket from line 12 after that.
19th Apr 2020, 4:34 PM
Denise Roßberg
Denise Roßberg - avatar
0
break is only used in loops and switch statements... It doesn't work in conditional statements... It works if the conditional stmt is in a loop... That's the problem... Try to resolve it...
19th Apr 2020, 4:56 PM
sarada lakshmi
sarada lakshmi - avatar