Skip to content

Instantly share code, notes, and snippets.

@kahunacohen
Created March 13, 2023 10:13
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 kahunacohen/87dcf08ac1d834a899e124704d8cbe68 to your computer and use it in GitHub Desktop.
Save kahunacohen/87dcf08ac1d834a899e124704d8cbe68 to your computer and use it in GitHub Desktop.
package main
import "fmt"
func main() {
nums := make([]int, 100)
for n := range nums {
o := n + 1
if o%15 == 0 {
fmt.Println("fizz buzz")
} else if o%3 == 0 {
fmt.Println("fizz")
} else if o%5 == 0 {
fmt.Println("buzz")
} else {
fmt.Println(o)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment