Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import "fmt"
import "math"
import "time"
func main() {
for i := 1.0; i < 101; i++ {
switch {
case math.Mod(i,3) == 0 && math.Mod(i,5) == 0:
fmt.Println("Fizz Buzz")
case math.Mod(i,3) == 0:
fmt.Println("Fizz")
case math.Mod(i,5) == 0:
fmt.Println("Buzz")
default:
fmt.Println(i)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment