Skip to content

Instantly share code, notes, and snippets.

@bwoff11
Created October 9, 2022 23:11
Show Gist options
  • Save bwoff11/5eee440b0a236cc229d3d1d7240c461e to your computer and use it in GitHub Desktop.
Save bwoff11/5eee440b0a236cc229d3d1d7240c461e to your computer and use it in GitHub Desktop.
golang fizzbuzz
package main
import "fmt"
var itterations int = 999
func main() {
for i := 0; i < itterations; i++ {
var toPrint string
if i%3 == 0 {
toPrint += "Fizz"
}
if i%5 == 0 {
toPrint += "Buzz"
}
if toPrint != "" {
fmt.Println(toPrint)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment