Skip to content

Instantly share code, notes, and snippets.

@gabrielrojasnyc
Created February 22, 2017 17:46
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 gabrielrojasnyc/b3a83960b8ca2e98871488fa4980dd1d to your computer and use it in GitHub Desktop.
Save gabrielrojasnyc/b3a83960b8ca2e98871488fa4980dd1d to your computer and use it in GitHub Desktop.
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