Skip to content

Instantly share code, notes, and snippets.

@AdamPI314
Created September 18, 2017 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamPI314/15859cab3da93154bae659be6de31ac5 to your computer and use it in GitHub Desktop.
Save AdamPI314/15859cab3da93154bae659be6de31ac5 to your computer and use it in GitHub Desktop.
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