# Challenge: Compute Factorial of a Number

This lesson brings you a challenge to solve.

## We'll cover the following

## Problem statement

Write a function that returns the **factorial** (!) of any `n`

number.
The factorial $n!$ of a number $n$ is defined as:

$n! = n * (n â€“ 1)! , where 0!=1 and 1!=1$

For example: **$5! = 5*4*3*2*1= 120$**

## Input

A number of type **uint64**, `n`

## Output

A number of type **uint64** (because the number increases drastically due to multiplication)

Results will be correct until only `21!`

. After that, the *overflow-error* will occur.

Remark: When using typeintthe calculation is only correct up until`12!`

. This is, of course, because anintcan only contain integers that fit in 32 bits. And, Go doesnâ€™t usually warn against this overflow-error!

## Sample input

```
10
```

## Sample output

```
3628800
```

Try to implement the function below. Feel free to view the solution, after giving some shots. Good Luck!

Get hands-on with 1200+ tech skills courses.