Created
October 9, 2022 23:11
-
-
Save bwoff11/5eee440b0a236cc229d3d1d7240c461e to your computer and use it in GitHub Desktop.
golang fizzbuzz
This file contains hidden or 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" | |
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