# Find Factorial program in GO Example

Today, We want to share with you Find Factorial program in GO.In this post we will show you algorithm to find factorial of a number using recursion, hear for write a GO program to find factorial of a number using function we will give you demo and example for implement.In this post, we will learn about find factorial of a number using recursive and non recursive method using GO Program with an example.

## Find Factorial program in GO

Contents

There are the Following The simple About Find Factorial program in GO Full Information With Example and source code.

As I will cover this Post with live Working example to develop GO Program to Find Factorial of a Number, so the factorial of a number in GO for this example is following below.

Also Read This π   StringsAreSorted function in GO language program

here in this example declare uint64 is the set of all simple datatype like as a unsigned 64-bit integers. and var i int and var n int , var fetchFactVal uint64 are Variable Declaration.

Program to find Factorial of number using Go

```package main
import "fmt"

var fetchFactVal uint64 = 1

var i int = 1
var n int

func fetchFactorial(n int) uint64 {
if(n < 0){
fmt.Print("Factorial of negative number doesn't exist.")
}else{
for i:=1; i<=n; i++ {
fetchFactVal *= uint64(i)
}

}
return fetchFactVal
}

func main(){
fmt.Print("Please Enter a any positive integer between Range 0 - 50 : ")
fmt.Scan(&n)
}
```

In above Go program I have make simple a function “fetchFactorial” which returns a value of uint64 data.

Free Live Chat for Any Issue