Compilers Questions and Answers – Three-Address Statements – 2

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Three-Address Statements – 2”.

1. In a two pass assembler, adding literals to literal table and address resolution of local symbols are done using?
a) First pass and second respectively
b) Both second pass
c) Second pass and first respectively
d) Both first pass
View Answer

Answer: d
Explanation: A two pass assembler does two passes over the source file (the second pass can be over a file generated in the first pass).

2. In Two pass assembler the object code generation is done during the ______________
a) Second pass
b) First pass
c) Zeroth pass
d) Not done by assembler
View Answer

Explanation: On the second pass, the assembler:
• source statements into machine code
• error messages, if error has occurred.

3. Pick the machine independent phase of the compiler.
a) Syntax analysis
b) Code generation
c) Lexical analysis
d) All of the mentioned
View Answer

Answer: d
Explanation: Machine independent phases are Lexical analysis, Syntax analysis, Semantic analysis, Intermediate code generation and sometime code optimization.

4. A system program that combines the separately compiled modules of a program into a form suitable for execution is?
a) Assembler
b) Linking loader
c) Cross compiler
d) Load and Go
View Answer

Answer: b
Explanation: Combines the modules which have been compiled separately.

5. Which of the following type of software should be used if you need to create, edit and print documents?
a) Word processing
b) Spreadsheet
c) Desktop publishing
View Answer

Answer: an
Explanation: Application software such as word processors.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Output file of the Lex is _________ is the input file is Sam.
a) sam
b) sam.yy.c
c) sam.lex
d) sam.obj
View Answer

Answer: b
Explanation: This Produce the file “sam.yy.c”, which we can then compile with g++.

7. Type checking is normally done during ____________
a) Lexical analysis
b) Syntax analysis
c) Syntax directed translation
d) Code generation
View Answer

Answer: c
Explanation: It enables the compiler to do type checking.

8. Yacc is available as a command on the ____________
c) DOS
d) None of the mentioned
View Answer

Answer: b
Explanation: Unix provides with a YACC command.

9. Loading process can be divided into two programs. The first is binder the other is ____________
a) Linkage editor
b) Module Loader
c) Relocate
d) None of the mentioned
View Answer

Answer: b
Explanation: A module loader is an answer.

10. In Lex, a class is complemented by first placing ____________
a) ^
b) OR
c) –
d) NOT
View Answer

Answer: a
Explanation: ^ =complement.

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.