Last active
January 10, 2020 21:05
-
-
Save monkrus/98692dc0112dd2ba8e9a1b2d3699d2be to your computer and use it in GitHub Desktop.
Nested loop in go
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
Loop: | |
for i := 1; i <= 3; i++ { | |
for j := 1; j <= 3; j++ { | |
fmt.Println(i * j) | |
if i*j >= 3 { | |
break Loop | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment