250+ TOP MCQs on Stages of Compilation and Answers

1. The lines in our code that begin with the “#” character are
a) preprocessor directives
b) macros
c) header files
d) none of the mentioned

Answer: a
Clarification: None.

2. Command line parameters are passed by the
a) preprocessor
b) assembler
c) compiler
d) linker

Answer: d
Clarification: None.

3. In the preprocessing stage of compilation
a) header files are actually expanded and included in the source code of the program
b) macros are replaced by their respective values
c) all the comments are stripped off
d) all of the mentioned

Answer: d
Clarification: None.

4. Which compilation step makes sure that all the undefined symbols in the code are resolved.
a) linking
b) compiling
c) preporcessing
d) none of the mentioned

Answer: a
Clarification: An undefined symbol is one for which there is no definition available.

5. Which one of the following is not true?
a) we need to manually go through all intermediate stages to generate an executable in gcc
b) gcc compilation process always contains 4 stages
c) gcc compilation process always contains 3 stages
d) none of the mentioned

Answer: a
Clarification: None.

6. Preprocessed files are given the file extension _____ for c++ programs.
a) .i
b) .ii
c) .iii
d) none of the mentioned

Answer: b
Clarification: None.

7. The assmebly code generated depends upon the
a) processor archietecture
b) ram size
c) both processor archietecture and RAM size
d) none of the mentioned

Answer: c
Clarification: None.

8. The COFF stands for
a) common object file format
b) combined operation for file formats
c) combined object file format
d) none of the mentioned

Answer: a
Clarification: None.

Leave a Reply

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