34. Go - Continue
Continue statement allows continuing of the loop but voiding everything below it.
package main
import "fmt"
func main() {
for i := 0; i < 10; i++ {
if i%2 == 0 {
fmt.Println("EVEN", i)
continue
}
fmt.Println("ODD", i)
}
}
Comments
Post a Comment