Sobes.tech
Intern — Middle

Recursive calculation of a number's factorial

livecode

Task condition

You need to write a recursive function that returns the factorial of a given number.

int factorialRecursive(int num) {
    // implement recursive factorial calculation
}

Examples of usage:

factorialRecursive(5) → 120
factorialRecursive(0) → 1