Multiple choice

Which of the following is incorrect? A recursive function

  1. calls itself

  2. is equivalent to the loop

  3. has termination condition

  4. does not return a value

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Recursive functions are capable of returning values, such as the result of a factorial or Fibonacci calculation. The other statements are true: they call themselves, require a termination condition to avoid infinite loops, and can be logically replaced by iterative loops.