Tuesday, October 8, 2013

Factorial

Factorial is the product of all the non-negative integers less  than or equal to the given number n.

Factorial , C++ implementation 

int Factorial(int n)
{
    if (n == 0)
    {
        return 1;
    }
   
    return n * Factorial(n - 1);
}

No comments:

Post a Comment