Skip to content

Instantly share code, notes, and snippets.

@shockalotti
Last active August 29, 2015 14:01
Show Gist options
  • Save shockalotti/b7d70aedb4fa74265155 to your computer and use it in GitHub Desktop.
Save shockalotti/b7d70aedb4fa74265155 to your computer and use it in GitHub Desktop.
Go Golang - If statement
package main
import "fmt"
func main() {
for i:=1; i<=50; i++ {
if i % 2 == 0 {
fmt.Println("even")
} else if i % 3 == 0 {
fmt.Println("odd")
} else {
fmt.Println("not even nor odd")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment