re: Fizz Buzz in Every Language VIEW POST

FULL DISCUSSION
 

Here's a solution in Go.

package main

import (
    "fmt"
)

func main() {
    for num := 1; num < 101; num++ {
        if num % 3 != 0 && num % 5 != 0 {
            fmt.Println(num)
            continue
        }
        if num % 3 == 0 {
            fmt.Print("Fizz")
        }
        if num % 5 == 0 {
            fmt.Print("Buzz")
        }
        fmt.Println()
    }
}
code of conduct - report abuse