New course! Every coder should learn Generative AI!
Try a free lesson+ 2
does Break work with if statement?
4 Answers
+ 1
It breaks out of the enclosing loop
Check this example
http://code.sololearn.com/cxcoa29sC8ps
+ 1
No. break works for loops only.
0
yes
- 4
it will break out from the if condition...!!