Skip to content

Instantly share code, notes, and snippets.

@RakshithNM
Created December 17, 2020 07:42
Show Gist options
  • Select an option

  • Save RakshithNM/abf8d42a8c04008bc2896c8ea3e07f70 to your computer and use it in GitHub Desktop.

Select an option

Save RakshithNM/abf8d42a8c04008bc2896c8ea3e07f70 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"strconv"
)
func main() {
for i := 1; i <= 100; i++ {
if i%15 == 0 {
fmt.Println("FizzBuzz")
} else if i%3 == 0 {
fmt.Println("Fizz")
} else if i%5 == 0 {
fmt.Println("Buzz")
} else {
s := strconv.Itoa(i)
fmt.Println(s)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment