Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- main()
- {
- for(new i; i < 3; i++)
- {
- printf("Level 1: %d", i);
- for(new j; j < 3; j++)
- {
- if(j == 1)
- continue;
- printf(" -Level 2: %d", j);
- }
- }
- // Example for breaking the outer loop from within the nested loop.
- new shouldbreak;
- for(new i; i < 3; i++)
- {
- for(new j; j < 3; j++)
- {
- if(i == 1 && j == 1)
- {
- shouldbreak = true;
- break;
- }
- }
- if(shouldbreak)
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement