1.

Which of the following statements is false about recursion?(a) Every recursive function must have a base case(b) Infinite recursion can occur if the base case isn’t properly mentioned(c) A recursive function makes the code easier to understand(d) Every recursive function must have a return valueThis question was posed to me in quiz.This is a very interesting question from Recursion in section Argument Passing, Global vs Local Variables, Shallow copy vs Deep copy and Recursion of Python

Answer»

Correct choice is (d) Every recursive FUNCTION must have a return VALUE

Best explanation: A recursive function needn’t have a return value.



Discussion

No Comment Found

Related InterviewSolutions