I have a nested loop and in the internal loop I am doing a condition check and if that condition check Is satisfied i want to jump to the next iteration of the external loop.
It goes something like this
for( int i = 0 ; i < n ; i++ ){
for( int j = 0 ; j < n ; j++ ){
if( condition ){
// Move to next iteration of first or external loop
// skip the work and work2 both
}
// some work being done
work();
}
work2();
}
What I mean here is If the condition is satisfied at i = 2 and j = 5
I want to move to i = 3
Is there any way to do without using Booleans something similar to the break statement ?