Lets say I have 5 nested loops.
I have a break statement in the innermost loop. Will I get out of all the nested 5 loops if I reach the break statement ? or Will the control go to the 4th loop (because it exited the 5th loop) ?
Will break help me in getting out of all nested loops?
@sohamsdays break statements will break you out of the immediate loop you are in. So in this case you will exit the 5th nested loop and the control will go back to the 4th nested loop
Thanks for the clarification.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.