Created
September 5, 2016 17:40
-
-
Save marshallmassengill/bf4d34dca2b64f1a7ca38c3817aae306 to your computer and use it in GitHub Desktop.
FizzBuzz.go
This file contains 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
/* | |
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