Last active
March 29, 2018 06:59
-
-
Save burubur/977bc67ed3ed489c10ad27d0200a1fd4 to your computer and use it in GitHub Desktop.
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() { | |
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