250+ TOP MCQs on Three-Address Statements and Answers

Compilers Multiple Choice Questions & Answers (MCQs) on “Three-Address Statements”.

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

Answer: d
Clarification: 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

Answer:a
Clarification: 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

Answer: d
Clarification: 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

Answer: b
Clarification: 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
d) UNIX

Answer: an
Clarification: Application software such as word processors.

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

Answer: b
Clarification: 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

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

8. Yacc is available as a command on the ____________
a) MINIX
b) UNIX
c) DOS
d) None of the mentioned

Answer: b
Clarification: 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

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

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

Answer: a
Clarification: ^ =complement.

Leave a Reply

Your email address will not be published. Required fields are marked *