Skip to content
Quiz · Algorithms and Complexity · lesson 6 of 9

Quiz — the base case of recursion

Which line, added at the top of factorial, makes factorial(3) return 6?

C++
int factorial(int n) {
    return n * factorial(n - 1);
}