My code is something like this:-
for() //outer for
{
for() //inner for
{
if()
{
break;
}
}
}
If the break statement executes the next execution will be of which for loop?
I know this is a very abstract question but I really don’t have time to write the full code. Thanks.
breakwill break the inner for**loop**only. It breaks the closest loop ONLY where it was called.In your example, if your
ifcondition is satisfied, it will stop iterations of the inner for loop and move back(continue) the outer for loop.