Created
September 18, 2017 16:18
-
-
Save AdamPI314/15859cab3da93154bae659be6de31ac5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
n := 15 | |
fizz := "Fizz" | |
buzz := "Buzz" | |
if n%3 == 0 && n%5 == 0 { | |
fmt.Println(fizz + buzz) | |
} else if n%3 == 0 { | |
fmt.Println(fizz) | |
} else if n%5 == 0 { | |
fmt.Println(buzz) | |
} else { | |
fmt.Println(n) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment