AhmedSaed26

Learn GO

Apr 6th, 2022
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.28 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     for i := 1; i < 20; i++ {
  9.         if i%3 == 0 && i%5 == 0 {
  10.             fmt.Print("FizzBuzz")
  11.         } else if i%5 == 0 {
  12.             fmt.Print("Buzz")
  13.         } else if i%3 == 0 {
  14.             fmt.Print("Fizz")
  15.         } else {
  16.             fmt.Print(i)
  17.         }
  18.         fmt.Print("  ")
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment