Skip to main content

Compiler Construction MCQs with Answers

Practice important Compiler Construction MCQs with answers and explanations.

Multiple Choice Questions

Q1001: In the expression a = b * -c + b * -c, the first temporary variable t1 is assigned to ______.
  • A: b
  • B: -c
  • C: t1 = –c
  • D: t1 = b
View Answer
C

Q1002: In the parse of a = b * -c + b * -c, t2 is assigned the value of ______.
  • A: b * t1
  • B: t1 + t4
  • C: b * -c
  • D: t4 = b * t3
View Answer
A

Q1003: The temporary t3 in the three-address code represents the value of ______.
  • A: –c
  • B: b * c
  • C: b * t1
  • D: t2 + t4
View Answer
A

Q1004: In the statement a = t5, t5 holds the value of ______.
  • A: t2 + t4
  • B: b * c
  • C: –c
  • D: b * t1
View Answer
A

Q1005: A quadruple in three-address code consists of ______ fields.
  • A: 2
  • B: 3
  • C: 4
  • D: 5
View Answer
C

Q1006: The four fields in a quadruple are: operator, two operands, and ______.
  • A: source
  • B: destination
  • C: opcode
  • D: label
View Answer
B

Q1007: In three-address code, the index of the array element acts as the ______.
  • A: operator
  • B: destination
  • C: quadruple number
  • D: operand
View Answer
C

Q1008: Which data structure can be used to overcome the maximum size limitation of arrays of quads?
  • A: linked list
  • B: stack
  • C: queue
  • D: tree
View Answer
A

Q1009: The syntax-directed translation scheme for flow-of-control statements includes which of the following?
  • A: if-then-else
  • B: while-do
  • C: if-then
  • D: All of the above
View Answer
D

Q1010: In the three-address code for if c < d then x = y + z else x = y – z, the label L1 points to the statement
  • A: x = y + z
  • B: x = y – z
  • C: goto L2
  • D: nop
View Answer
A

Test Your Knowledge

Take a timed quiz on Compiler Construction

🚀 Start Quiz Now