@AdilKhn/FizzBuzz- GO
Go

No description

repl talk
Files
  • main.go
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main

import "fmt"


func doPrint(input int){
	if (input % 3 == 0 && input % 5 == 0 ){
		fmt.Println("FizzBuzz")
		return
	}
	
	if (input % 3 == 0){
		fmt.Println("Fizz")
		return
	}
	
	if (input % 5 == 0){
		fmt.Println("Buzz")
		return
	}
	
	fmt.Println(input)
	
}

func main() {
  for i := 0; i <= 100; i++ {
		doPrint(i)
	}
 
}
go version go1.9.4 linux/amd64