Skip to content

Instantly share code, notes, and snippets.

@fabianobizarro
Last active July 26, 2022 00:55
Show Gist options
  • Save fabianobizarro/c42112417e6c81838490cb98cb75dc05 to your computer and use it in GitHub Desktop.
Save fabianobizarro/c42112417e6c81838490cb98cb75dc05 to your computer and use it in GitHub Desktop.
Fizzbuzz
package main
import "fmt"
func main() {
count := 15
for i := 1; i <= count; i++ {
if i % 15 == 0 {
fmt.Print("FizzBuzz ")
} else if i % 5 == 0 {
fmt.Print("Buzz ")
} else if i % 3 == 0 {
fmt.Print("Fizz ")
} else {
fmt.Printf("%d ", i)
}
}
fmt.Println()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment