Advertisement
Southclaw

Untitled

Sep 2nd, 2013
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.44 KB | None | 0 0
  1. main()
  2. {
  3.     for(new i; i < 3; i++)
  4.     {
  5.         printf("Level 1: %d", i);
  6.  
  7.         for(new j; j < 3; j++)
  8.         {
  9.             if(j == 1)
  10.                 continue;
  11.  
  12.             printf(" -Level 2: %d", j);
  13.         }
  14.     }
  15.  
  16.     // Example for breaking the outer loop from within the nested loop.
  17.  
  18.     new shouldbreak;
  19.  
  20.     for(new i; i < 3; i++)
  21.     {
  22.         for(new j; j < 3; j++)
  23.         {
  24.             if(i == 1 && j == 1)
  25.             {
  26.                 shouldbreak = true;
  27.                 break;
  28.             }
  29.         }
  30.  
  31.         if(shouldbreak)
  32.             break;
  33.     }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement