Skip to content

Instantly share code, notes, and snippets.

@burubur
Last active March 29, 2018 06:59
Show Gist options
  • Save burubur/977bc67ed3ed489c10ad27d0200a1fd4 to your computer and use it in GitHub Desktop.
Save burubur/977bc67ed3ed489c10ad27d0200a1fd4 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
fmt.Println("Even or Odd.")
evenOrOdd()
}
func evenOrOdd() {
action := map[int]string{0: "The number is odd", 1: "The number is even"}
for i := 0; i <= 10; i++ {
fmt.Println(action[i%2])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment