Question:

Which of the following intermediate code representations is typically used to represent expressions where each instruction has at most three operands?

Show Hint

Three Address Code is highly beneficial for code optimization because its simplified, linear format makes it easy to apply techniques like constant folding or common subexpression elimination.
Updated On: Jul 4, 2026
  • Postfix Notation
  • Syntax Trees
  • Three Address Code
  • Directed Acyclic Graph
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept: Intermediate code acts as a bridge between the high-level source code and the machine-specific assembly code.
Linear Representation: Represents the program as a sequence of simple operations.
Quadruples/Triples: Common implementations of three-address code.

Step 1:
Understanding the structure of instructions.
Three-address code (TAC) consists of instructions with at most three addresses. A general instruction looks like: $x = y \text{ op } z$

Step 2:
Counting the operands.
In the format $x = y \text{ op } z$: $x$ is the result address (1st), $y$ is the first operand (2nd), and $z$ is the second (3rd). Complex expressions are broken down into multiple TAC instructions.

Step 3:
Comparing with other types.
Postfix (A) is a 1-address/stack-based representation. Syntax Trees (B) and DAGs (D) are graphical, not instruction-based representations.
Was this answer helpful?
0
0