Last active
December 30, 2015 20:59
-
-
Save sergiotapia/7884903 to your computer and use it in GitHub Desktop.
FizzBuzz written using Golang!
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
package main | |
import "fmt" | |
func main() { | |
i := 1 | |
for i <= 100 { | |
if (i % 3 == 0 && i % 5 == 0) { | |
fmt.Println("Fizzbuzz") | |
} else if (i % 3 == 0) { | |
fmt.Println("Fizz") | |
} else if (i % 5 == 0) { | |
fmt.Println("Buzz") | |
} else { | |
fmt.Println(i) | |
} | |
i = i + 1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment