Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main () {
- for i := 1; i < 101; i++ {
- result := ""
- switch {
- case i % 3 == 0 : result += "Fizz"; fallthrough
- case i % 5 == 0 : result += "Buzz"
- default : result = fmt.Sprintf("%d", i)
- }
- fmt.Println(result)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement