Which of the following is the correct base case for a recursive function that…

Bihar STET · PGT (Paper 2) · Computer Science · 2025

Which of the following is the correct base case for a recursive function that computes the factorial of a non-negative integer n, so that the recursion terminates correctly for every valid input (including n = 0)?

  1. A.

    n == 0

  2. B.

    n == 1

  3. C.

    n < 0

  4. D.

    n > 0

Attempted by 967 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Explore the full course: Bihar Stet Paper Ii Computer Science

Loading lesson…