This function calculate the factorial of a number by n.
int dg_factorial(int n);
int dg_factorial(5);
int dg_factorial(int n)
{
int result = 1;
for (int i = 2; i <= n; i++)
result *= i;
return result;
}