Skip to content

Instantly share code, notes, and snippets.

@sergiotapia sergiotapia/go-fizzbuzz.go
Last active Dec 30, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.