Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save marshallmassengill/bf4d34dca2b64f1a7ca38c3817aae306 to your computer and use it in GitHub Desktop.
Save marshallmassengill/bf4d34dca2b64f1a7ca38c3817aae306 to your computer and use it in GitHub Desktop.
FizzBuzz.go
/*
Basic FizzBuzz written in Go. Just felt like writing it.
*/
package main
import "fmt"
func main() {
for i := 1; i <= 100; i++ {
if i%3 == 0 {
fmt.Printf("Fizz");
}
if i%5 == 0 {
fmt.Printf("Buzz");
}
if i%3 != 0 && i%5 != 0 {
fmt.Printf("%d", i);
}
fmt.Println();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment