GCC Compiler Questions & Answers – Stages of Compilation – 2

This set of Linux / Unix questions and answers focuses on various stages of compilation for gcc compiler. This is set 1.

1. The a.out file is in the
a) ELF format
b) EXE format
c) Both EXE and ELF format
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

2. Which one of the following command can be used to provide executable permissions for a file?
a) chmod +x <filename>
b) chmod 777 <filename>
c) both chmod +x and chmod 777
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

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

Answer: a
Explanation: None.

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

Answer: d
Explanation: None.
advertisement
advertisement

5. 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
View Answer

Answer: d
Explanation: None.

6. 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
View Answer

Answer: a
Explanation: An undefined symbol is one for which there is no definition available.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. 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
View Answer

Answer: a
Explanation: None.

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

Answer: b
Explanation: None.
advertisement

9. 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
View Answer

Answer: c
Explanation: None.

10. 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
View Answer

Answer: a
Explanation: None.
advertisement

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.

Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

advertisement
advertisement
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.