Skip to content

Instantly share code, notes, and snippets.

@dgershman
Created July 6, 2016 02:33
Show Gist options
  • Save dgershman/ea7a3ec7a19f768a65252a3e1918bde2 to your computer and use it in GitHub Desktop.
Save dgershman/ea7a3ec7a19f768a65252a3e1918bde2 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
for x := 1; x <= 100; x++ {
if (x % 5 == 0 && x % 3 == 0) {
fmt.Println("FizzBuzz")
} else if (x % 5 == 0) {
fmt.Println("Buzz")
} else if (x % 3 == 0) {
fmt.Println("Fizz")
} else {
fmt.Println(x)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment