MCQ
Observe the following piece of code?

  • A
    Both a() and b() aren't tail recursive
  • B
    Both a() and b() are tail recursive
  • b() is tail recursive but a() isn't
  • D
    a() is tail recursive but b() isn't

Answer

Correct option: C.
b() is tail recursive but a() isn't
(c) Explanation: A recursive function is tail recursive when recursive call is executed by the function in the last.

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free