Skip to content
Official PYQ · 1994

GATE CS 1994 Q17a — Lexical Analysis

Explain with AI
State whether the following statements are True or False with reasons for your answer:

Coroutine is just another name for a subroutine.
View worked solution

Answer: 1

The statement is False.

Explanation:

A subroutine and a coroutine are distinct control flow mechanisms with fundamental differences:

  • Subroutine (Procedure/Function): Follows a strict hierarchical (caller-callee) relationship. A subroutine always starts execution from the very beginning (single entry point) and runs until it returns control to the caller (single exit point), destroying its activation record upon termination.
  • Coroutine: Supports cooperative, symmetric control transfer. A coroutine can suspend its execution at any point (often using a yield statement) to pass control to another coroutine. When resumed, it continues execution from the exact point where it was suspended, preserving its local state and execution context.

Thus, a coroutine is not just another name for a subroutine.

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

Published
Report a correction
Keep exploringMore Lexical Analysis questions