Go Data Type uint64 Calculate Factorial
package main//from w w w .j a va2 s . c o m import "fmt" var factVal uint64 = 1 var i int = 1 var n int func factorial(n int) uint64 { if(n < 0){ fmt.Print("Factorial of negative number doesn't exist.") }else{ for i:=1; i<=n; i++ { factVal *= uint64(i) // mismatched types int64 and int } } return factVal } func main(){ n = 10 fmt.Print("Factorial is: ",factorial(n)) }