Engineering Questions with Answers - Multiple Choice Questions
Home » MCQs » Engineering MCQs » MCQs on Writing Software for Embedded Systems
MCQs on Writing Software for Embedded Systems
1 - Question
MCQs on The Compilation Process
Which of the following function can interpret data in the C language?
a) printf
b) scanf
c) proc
d) file
View Answer
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 - Question
What is the first stage of the compilation process?
a) pre-processing
b) post-processing
c) compilation
d) linking
View Answer
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 - Question
Which of the following produces an assembler file in the compilation process?
a) pre-processor
b) assembler
c) compiler
d) post-processing
View Answer
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
4 - Question
Which file is converted to an object file?
a) hex file
b) decoded file
c) coded file
d) assembly file
View Answer
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 - Question
Which of the following contains the hexadecimal coding?
a) object file
b) assembly file
c) coded file
d) decoded file
View Answer
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.
6 - Question
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
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 - Question
Which of the following allows the programmer to define constants?
a) pre-processor
b) compiler
c) emulator
d) debugger
View Answer
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.
8 - Question
Which statement replaces all occurrences of the identifier with string?
a) # define identifier string
b) # include
c) # define MACRO()
d) # ifdef
View Answer
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 - Question
Which of the following has the include file?
a) emulator
b) debugger
c) pre-processor
d) simulator
View Answer
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.
10 - Question
Which statement is used to condense the code to improve the eligibility?
a) # define MACRO()
b) # include
c) if
d) else-if
View Answer
Explanation: The # define MACRO() statement is used to condense the code for improving the code eligibility or for space reasons.
11 - Question
MCQs on The Compilation Process-II
Which of the following are header files?
a) #include
b) file
c) struct()
d) proc()
View Answer
Explanation: The #include is a header file which defines the standard constants, variable types, and many other functions. This can also include some standard libraries.
12 - Question
Which is the standard C compiler used for the UNIX systems?
a) simulator
b) compiler
c) cc
d) sc
View Answer
Explanation: The cc is the standard C compiler used in the UNIX system. Its command lines can be pre-processed, compiled, assembled and linked to create an executable file.
13 - Question
Which compiling option is used to compile programs to form part of a library?
a) -c
b) -p
c) -f
d) -g
View Answer
Explanation: There are several options for the compilers. The option -c compiles the linking stage and then leaves the object file. This option is used to compile programs to form a part of the library. advertisement
14 - Question
Which compiling option can be used for finding which part of the program is consuming most of the processing time?
a) -f
b) -g
c) -p
d) -c
View Answer
Explanation: The -p instructs the compiler to produce codes which count the number of times each routine is called and this is useful for finding the processing time of the programs.
15 - Question
Which compiling option can generate symbolic debug information for debuggers?
a) -c
b) -p
c) -f
d) -g
View Answer
Explanation: The -g generates the symbolic debug information for the debuggers. Without this, the debugger cannot print the variable values, it can only work at the assembler level. The symbolic information is passed through the compilation process and stored in the executable file.
16 - Question
Which of the following is also known as loader?
a) locater
b) linker
c) assembler
d) compiler
View Answer
Explanation: The linker is also known as a loader. It can take the object file and searches the library files to find the routine it calls.
17 - Question
Which of the following gives the final control to the programmer?
a) linker
b) compiler
c) locater
d) simulator
View Answer
Explanation: The linker can give the final control to the programmer concerning how unresolved references are reconciled, where the sections are located in the memory, which routines are used, and so on.
18 - Question
Which command takes the object file and searches library files to find the routine calls?
a) simulator
b) emulator
c) debugger
d) linker
View Answer
Explanation: The linker is also known as a loader. It can take the object file and searches the library files to find the routine it calls. The linker can give the final control to the programmer concerning how unresolved references are reconciled, where the sections are located in the memory, which routines are used, and so on.
19 - Question
Which assembler option is used to turn off long or short address optimization?
a) -n
b) -V
c) -m
d) -o
View Answer
Explanation: The option -o puts the assembler into the file obj file, -V can write the assembler’s version number on the standard error output, -m runs the macro preprocessor on the source file and -n turns off the long or short address optimization.
20 - Question
Which assembler option runs the m4 macro preprocessor on the source file?
a) -n
b) -m
c) -V
d) -o
View Answer
Explanation: The option -o puts the assembler into the file obj file, -V can write the assembler’s version number on the standard error output, -m runs the macro preprocessor on the source file and -n turns off the long or short address optimization.