Skip to content

Instantly share code, notes, and snippets.

@sergiotapia
Last active December 30, 2015 20:59
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 sergiotapia/7884903 to your computer and use it in GitHub Desktop.
Save sergiotapia/7884903 to your computer and use it in GitHub Desktop.
FizzBuzz written using Golang!
package main
import "fmt"
func main() {
i := 1
for i <= 100 {
if (i % 3 == 0 && i % 5 == 0) {
fmt.Println("Fizzbuzz")
} else if (i % 3 == 0) {
fmt.Println("Fizz")
} else if (i % 5 == 0) {
fmt.Println("Buzz")
} else {
fmt.Println(i)
}
i = i + 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment