Compiler Design - Practice Set 1
Compiler Design - Practice Set 1
1. What is a compiler?
a) system program that converts instructions to machine language
b) system program that converts machine language to high-level language
c) system program that writes instructions to perform
d) None of the mentioned
Answer: a
Explanation: A compiler is a system program that converts instructions in form of code to machine
understandable language.
5. A programmer, writes a program to multiply two numbers instead of dividing them by mistake, how
can this error be detected?
a) Compiler or interpreter
b) Compiler only
c) Interpreter only
d) None of the mentioned
Answer: d
Explanation: This is a logical error that can’t be detected by any compiler or interpreter.
advertisement
7. Which of the following is known as a compiler for a high-level language that runs on one machine and
produces code for a different machine?
a) Cross compiler
b) Multipass compiler
c) Optimizing compiler
d) One pass compiler
Answer: a
Explanation: So done by the definition.
8. Which of the following is a system program that integrates a program’s individually compiled modules
into a form that can be executed?
a) Interpreter
b) Assembler
c) Compiler
d) Linking Loader
Answer: d
Explanation: A loader that combines the functionality of a relocation loader with the ability to combine a
number of independently compiled program segments.