Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Programming in C
Functions & recursion
Official Paper
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
End Term · 31 Aug 2025 (FN)End Term
- Q1MCQ4 Marks·Choose one option
When a recursive function is called, how does the call stack (or program stack) manage the function calls?
- AEach new recursive call overwrites the previous function call on the stack.
- BEach new recursive call adds a new stack frame to the top of the stack for its local variables and parameters.
- CThe call stack is not used for recursive functions; a separate data structure is used.
- DThe recursive calls are stored in a queue, waiting to be processed in order.
- Q2MCQ4 Marks·Choose one option

- A

- B

- C

- D

- A
- Q3MCQ5 Marks·Choose one option

- A0501
- B150
- C501
- D1050
End Term · 31 Aug 2025 (AN)End Term
- Q4MCQ4 Marks·Choose one option
What is a potential risk of a recursive function that is not properly terminated with a base case?
- AIt will cause a compile-time error.
- BIt will always return an incorrect value.
- CIt can lead to a stack overflow, as the function calls consume all available stack memory.
- DThe program will terminate gracefully with a success message.
- Q5MCQ4 Marks·Choose one option
What is the fundamental conceptual difference between "pass-by-value" and "pass-by-reference" for function parameters in C?
- APass-by-value is used for primitive types, while pass-by-reference is used for composite types.
- BIn pass-by-value, a function works with a copy of the argument, whereas in pass-by-reference, it works with the original variable via its memory address.
- CPass-by-value allows a function to modify the original variable, while pass-by- reference protects the original variable from modification.
- DThe choice between pass-by-value and pass-by-reference is made automatically by the compiler based on the variable's type.
- Q6MCQ5 Marks·Choose one option
Consider the following C code:
What is the output of the program?- A5
- B101
- C10
- D111