Skip to content

Instantly share code, notes, and snippets.

@gcv
Created November 27, 2014 22:29
Show Gist options
  • Save gcv/693532d603db3e19078a to your computer and use it in GitHub Desktop.
Save gcv/693532d603db3e19078a to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
for i := 1; i <= 100; i++ {
if i % 3 == 0 {
fmt.Print("Fizz")
}
if i % 5 == 0 {
fmt.Print("Buzz")
}
if i % 3 != 0 &&
i % 5 != 0 {
fmt.Print(i)
}
fmt.Println()
}
}
package main
import "fmt"
func main() {
for i := 1; i <= 100; i++ {
if i%3 == 0 {
fmt.Print("Fizz")
}
if i%5 == 0 {
fmt.Print("Buzz")
}
if i%3 != 0 &&
i%5 != 0 {
fmt.Print(i)
}
fmt.Println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment