Created
November 21, 2016 04:21
-
-
Save ohsawa0515/a01f906097359b08e9c2819264f1da97 to your computer and use it in GitHub Desktop.
Fizz Buzz golang version.
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() { | |
max := 100 | |
for i := 1; i <= max; i++ { | |
if i % 3 == 0 && i % 5 == 0 { | |
fmt.Println("Fizz Buzz") | |
} else if i % 3 == 0 { | |
fmt.Println("Fizz") | |
} else if i % 5 == 0 { | |
fmt.Println("Buzz") | |
} else { | |
fmt.Println(i) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment