Skip to main content

Compiler Construction MCQs with Answers

Practice important Compiler Construction MCQs with answers and explanations.

Multiple Choice Questions

Q1011: In the code fragment: "if c < d goto L1; goto L2", which label is jumped to if c is not less than d?
  • A: L1
  • B: L2
  • C: L3
  • D: None
View Answer
B

Q1012: The function newlabel() in syntax-directed translation returns ______.
  • A: a new temporary variable
  • B: a new operator
  • C: a new symbolic label
  • D: a new quadruple
View Answer
C

Q1013: The "nop" statement in three-address code stands for ______.
  • A: no operation
  • B: new operation
  • C: next operation
  • D: not operation
View Answer
A

Q1014: Which is NOT a valid flow-of-control statement in most procedural programming languages?
  • A: for
  • B: switch
  • C: repeat-until
  • D: copy
View Answer
D

Q1015: In three-address code, the operand "-" in t5 – t4 t3 represents a ______ operation.
  • A: multiplication
  • B: subtraction
  • C: addition
  • D: division
View Answer
B

Q1016: In the syntax-directed translation of flow control, which statement checks a boolean expression?
  • A: if E then S1
  • B: while E do S1
  • C: both A and B
  • D: none
View Answer
C

Q1017: Which of the following is a type of three-address statement?
  • A: Assignment statement
  • B: Copy statement
  • C: Unconditional jump
  • D: All of the above
View Answer
D

Q1018: In three-address statements, the operation in x = y op z is called ______.
  • A: unary operator
  • B: binary operator
  • C: logical operator
  • D: relational operator
View Answer
B

Q1019: The statement x = y is an example of a ______ statement.
  • A: assignment
  • B: copy
  • C: conditional jump
  • D: unconditional jump
View Answer
B

Q1020: What does the statement "goto L" do in three-address code?
  • A: Executes the next statement
  • B: Jumps to the statement labeled L
  • C: Jumps to the next instruction
  • D: Ends the program
View Answer
B

Test Your Knowledge

Take a timed quiz on Compiler Construction

🚀 Start Quiz Now