Created
March 13, 2023 10:13
-
-
Save kahunacohen/87dcf08ac1d834a899e124704d8cbe68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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