Skip to content
Official PYQ · 2002

GATE CS 2002 Q1.17 — Programming in C

Explain with AI

In the C language:

Choose one option
View worked solution

Answer: B

In the C programming language, function calls are managed at runtime using a single call stack. Each active function call is represented by an activation record (or stack frame) on this stack.

  • Option A is incorrect: There is no limit on the number of intermediate function calls. If main() calls f1(), which calls f2(), which calls f3(), there will be multiple activation records between main and the current active function f3.
  • Option B is correct: The call stack grows and shrinks dynamically. The number of activation records currently residing on the stack between the active function and main() depends entirely on the sequence of active function calls at that point in execution.
  • Option C is incorrect: C uses static (lexical) scoping. The visibility of global variables is determined at compile-time based on their position in the source code, not by the runtime function calling sequence (which would be dynamic scoping).
  • Option D is incorrect: Recursive function calls do not require a separate stack. Each recursive call simply pushes a new activation record for the same function onto the standard runtime call stack.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Programming in C questions