Last active
July 26, 2022 00:55
-
-
Save fabianobizarro/c42112417e6c81838490cb98cb75dc05 to your computer and use it in GitHub Desktop.
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" | |
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