Skip to content

Instantly share code, notes, and snippets.

@jarrad
Last active August 28, 2015 19:53
Show Gist options
  • Save jarrad/ad9714abbe53c8a26d4f to your computer and use it in GitHub Desktop.
Save jarrad/ad9714abbe53c8a26d4f to your computer and use it in GitHub Desktop.
FizzBuzz in golang
package main
import "fmt"
func main() {
for i := 0; i < 100; i++ {
m3 := i % 3 == 0
m5 := i % 5 == 0
if (m3) {
fmt.Print("Fizz")
}
if (m5) {
fmt.Print("Buzz")
}
if (!m3 && !m5) {
fmt.Print(i)
}
fmt.Println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment