In the following pseudocode which uses recursion to find the factorial of a number, which is the base case? Module main() Declare Integer number Declare Integer numFactor Display "Enter a non-negative integer:" Input number Set numFactor = factor(number) Display "The factorial of ", number, " is ", numFactor End Module Function Integer factor(Integer n) If n == 0 Then Return 1 Else Return n * factor(n - 1) End If End Function

Respuesta :

Answer:

If n == 0 Then Return 1

Explanation:

The recursive function have 3 things which are as following:-

  1. Base case.
  2. Recursive call.
  3. Some calculation.

Base case is defined for the lowest or maximum value possible for the function to reach.Without the base case the recursive function will go in infinite loop means the function will keep calling itself and there will be no stopping that.So the base case prevent this from happening.