Skip to content

Instantly share code, notes, and snippets.

@caelifer
Last active September 18, 2015 22:13
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 caelifer/02202db05d82b023d641 to your computer and use it in GitHub Desktop.
Save caelifer/02202db05d82b023d641 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
for i := 1; i <= 45; i++ {
res := ""
if i%2 == 0 {
res += "Carr"
}
if i%3 == 0 {
res += "Fizz"
}
if i%5 == 0 {
res += "Buzz"
}
if len(res) == 0 {
fmt.Println(i)
} else {
fmt.Println(res)
}
}
}
@caelifer
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment