Last active
August 2, 2020 19:02
-
-
Save dichharai/0056fb14f4066ce11cecd4c788a2ed7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NestedForLoopBreak{ | |
public static void main(String[] args){ | |
label0: | |
for(int i=1; i<5; i++){ | |
for(int j=1; j<5; j++){ | |
for(int k=1; k<5; k++){ | |
int l3Product = i*j*k; | |
if(l3Product > 10){ | |
break label0; | |
} | |
System.out.printf("%d * %d * %d is: %d \n", i, j, k, l3Product); | |
} | |
} | |
} | |
System.out.println("Got out of 3 layer maze!"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment