Write a function called fact that recursively calculates the factorial value of its single int parameter.

LANGUAGE: C++

CHALLENGE:

Write a function called  fact that recursively calculates the factorial value  of its single int parameter. The value  returned by  fact is a  long ..

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. Aike on November 2, 2015 at 7:04 pm

    ACCEPTED RESPONSE:

    long fact(int n)
    {
    if(n < 1)
    return 1;
    else
    return n * fact(n-1);
    }

Leave a Comment

You must be logged in to post a comment.