Compiler Construction MCQs with Answers
Practice important Compiler Construction MCQs with answers and explanations.
Multiple Choice Questions
Q21: Code translation must ensure that machine code executes ______ as the source.
- A: Differently
- B: Faster
- C: Precisely the same
- D: Intermittently
View Answer
C
Q22: Which component receives 10% weight in course grading?
- A: Theory
- B: Project
- C: Exams
- D: Quizzes
View Answer
A
Q23: Which tool is used to compile C programs into machine code?
- A: GCC
- B: MS Word
- C: Photoshop
- D: PowerPoint
View Answer
A
Q24: leave in assembly is used to ________.
- A: Exit the loop
- B: Return from function
- C: Restore base pointer
- D: Multiply variables
View Answer
C
Q25: The line "incl %eax" in assembly does what?
- A: Decrements %eax
- B: Increments %eax
- C: Clears %eax
- D: Loads memory address
View Answer
B
Q26: How many assembly lines are generated for the function `expr`?
- A: 5
- B: 10
- C: 15
- D: More than 15
View Answer
D
Q27: In context of compilers, the term 'semantics' refers to ________.
- A: Syntax rules
- B: Execution order
- C: Meaning of constructs
- D: Variable naming
View Answer
C
Q28: The function expr returns an expression based on which variable?
- A: a
- B: b
- C: n
- D: c
View Answer
C
Q29: Assembly code is more suitable for ________.
- A: Humans
- B: Hardware
- C: Managers
- D: Students
View Answer
B
Q30: The book "Compilers – Principles, Techniques and Tools" is authored by ______.
- A: Aho, Sethi, Ullman
- B: Tanenbaum, Woodhull
- C: Dennis Ritchie, Ken Thompson
- D: Andrew Ng
View Answer
A