Embedded Systems Questions and Answers – The Compilation Process

This set of Embedded Systems Multiple Choice Questions & Answers (MCQs) focuses on “The Compilation Process”.

1. Which of the following function can interpret data in the C language?
a) printf
b) scanf
c) proc
d) file
View Answer

Answer: b
Explanation: The scanf and printf are the well-known functions in the C language which is used to interpret data and print data respectively.

2. What is the first stage of the compilation process?
a) pre-processing
b) post-processing
c) compilation
d) linking
View Answer

Answer: a
Explanation: The pre-processing involves the first stage of the compilation process in which the include files are added. This file defines the standard functions, constants etc and the output is fed to the compiler.

3. Which of the following produces an assembler file in the compilation process?
a) pre-processor
b) assembler
c) compiler
d) post-processing
View Answer

Answer: c
Explanation: The output of the pre-processor is given to the compiler in which it produces an assembler file from the instruction codes of the processor.
advertisement
advertisement

4. Which file is converted to an object file?
a) hex file
b) decoded file
c) coded file
d) assembly file
View Answer

Answer: d
Explanation: The output of the pre-processor is given to the compiler which produces an assembler file from the instruction codes of the processor and this possesses libraries. The assembly file is then converted into the object file and this contains the hexadecimal coding.

5. Which of the following contains the hexadecimal coding?
a) object file
b) assembly file
c) coded file
d) decoded file
View Answer

Answer: a
Explanation: The output of the pre-processor is given to the compiler which produces an assembler file from the instruction codes of the processor and this possesses libraries and then these assembly file is converted into the object file and this possesses the coding of hexadecimal.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which of the following processes the source code before it goes to the compiler?
a) compiler
b) simulator
c) pre-processor
d) emulator
View Answer

Answer: c
Explanation: The pre-processor is responsible for processing the source code before it goes to the compiler and this in turn allows the programmer to define variable types, constants, and much other information.

7. Which of the following allows the programmer to define constants?
a) pre-processor
b) compiler
c) emulator
d) debugger
View Answer

Answer: a
Explanation: The pre-processor processes the source code before it goes to the compiler and this allows the programmer to define variable types, constants, and much other information.
advertisement

8. Which statement replaces all occurrences of the identifier with string?
a) # define identifier string
b) # include
c) # define MACRO()
d) # ifdef
View Answer

Answer: a
Explanation: # define statement can replace all occurrences of the identifier with string. Similarly, it is able to define the constants, which also make the code easier to understand.

9. Which of the following has the include file?
a) emulator
b) debugger
c) pre-processor
d) simulator
View Answer

Answer: c
Explanation: The pre-processor produces the source code before it goes to the compiler and this allows the programmer to define variable types, constants, and much other information. This pre-processor also has to include files and combines them into the program source.
advertisement

10. Which statement is used to condense the code to improve the eligibility?
a) # define MACRO()
b) # include
c) if
d) else-if
View Answer

Answer: a
Explanation: The # define MACRO() statement is used to condense the code for improving the code eligibility or for space reasons.

Sanfoundry Global Education & Learning Series – Embedded System.

To practice all areas of Embedded System, 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]

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.