Skip to content

Instantly share code, notes, and snippets.

@jochasinga jochasinga/if.go
Created Sep 30, 2014

Embed
What would you like to do?
If condition in Go
package main
import "fmt"
func main() {
i := 1
for i <= 10 {
if i % 2 == 0 {
fmt.Println(i, "even")
} else {
fmt.Println(i, "odd")
}
i++
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.