1. Home
  2. Computer Science MCQs
  3. C Programming
  4. A recursive function must always have:

Added 30 Nov -0001

A recursive function must always have:

  1. a base case that stops the recursion Correct answer
  2. a global variable declared outside
  3. a return type of void
  4. at least two formal parameters

Correct answer

A. a base case that stops the recursion

16 views

MCQSEXAM

Explanation

Without a base case the recursion never terminates and eventually exhausts the stack.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs