R4RIN
MCQS
Unix/Lunux MCQ Quiz Hub
Linux Mcqs Questions Set 9
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. What is makefile?
makefile describes to the make command that how to compile the program
makefile contains various statements related with the compilation of target
makefile contains various statements
none of the mentioned
2. What is phony target in the makefile?
the target which is not a filename
the target which is a filename
the target which does not used for compilation
none of the mentioned
3. As we type “make” command on the terminal
make reads the makefile in the current directory
make reads the makefile in the parent directory
make reads the makefile in the predefined environment variable
none of the mentioned
4. The makefile starts executing from
first target
first target whose name starts with “.”
first target whose name does not starts with “.”
none of the mentioned
5. The command “make sanfoundry” will
create the executable if sanfoundry.c file is present in the current directory
create the object file named as sanfoundry.o
give an error
none of the mentioned
6. If our makefile is named as “sanfoundry”, then which one of the following command will compile the code with this makefile
make -a sanfoundry
make -f sanfoundry
make sanfoudry
make
7. Which option of make command print the commands that would be executed, but do not execute them?
-m
-n
-o
-p
8. If we want to get the exit status that specified targets are up to date or not, we have to execute the make command with option
-q
-r
-s
-t
9. Which make command option ignores all errors in commands executed to remark files?
-i
-j
-k
None
10. If make command is executed as “make -j 2”, then
two jobs will run simultaneously
only two will be executed
it will give an error
none of the mentioned
11. If we want to execute the makefile by just giving the “make” command, makefile should be named as
Makefile
makefile
MAKEFILE
None of the mentioned
12. Running “make” command without the arguments starts the target ____ in the makefile.
“.phony”
“clean”
first
none of the mentioned
13. In makefile the comment begins with the character
$
#
/*
none of the mentioned
14. Which one of the following is used for the target filename in the makefile?
$@
$*
$?
none of the mentioned
15. Which one of the following can be used to specify the directory to search the dependencies and target files?
VPATH
CPATH
FPATH
None of the mentioned
16. In the makefile the target and dependencies are separated by the character
–
:
/
none of the mentioned
17. Macros for the makefile can be defined in
makefile
command line
both makefile and command line
none of the mentioned
18. Which one of the following is not a valid makefile directive?
if
elif
endif
none of the mentioned
19. When a target of makefile fails to execute
make does not executes any other target dependent on it
it returns a status
make does not executes any other target dependent on it & it returns a status
none of the mentioned
20. Which one of the following provides all dependencies in the makefile?
$^
$*
$:
none of the mentioned
21. Which one of the following command creates the executable file a.out?
gcc -o sanfoundry.c
gcc sanfoundry.c
gcc -o a.out
gcc a.out
22. If we compile the sanfoudry.c file with the command “gcc -o sanfoundry sanfoundry.c”, then the executable file will be
a.out
sanfoundry
sanfoundry.out
none of the mentioned
23. If we compile the sanfoundry.c file with the command “gcc -c sanfoundry.c”, then the output file will be
sanfoundry.o
sanfoundry.s
sanfoundry.i
none of the mentioned
24. Which gcc option includes debugging info in the generated object code?
-g
-c
-p
none of the mentioned
25. The command “gcc -S sanfoundry.c” will
stop compilation process after the generation of assembly code file
generate sanfoundry.s file
stop compilation process after the generation of assembly code file & generate sanfoundry.s file
none of the mentioned
26. Which gcc option stops compilation process after preprocessing stage?
-e
-f
-E
-F
27. The -v option of gcc
print the commands executed to run the stages of compilation
version of the gcc compiler
all of the mentioned
none of the mentioned
28. Which gcc option turns off certain features of gcc that are incompatible with ISO C89?
-ansi
-ISO
-ver
none of the mentioned
29. The option -fsyntax-only of gcc
checks the code for syntax error
checks the code for fatal error
checks the code for syntax & fatal error
none of the mentioned
30. Which option of gcc inhibit all warning messages?
-w
-x
-y
-z
31. hat is the job of -Werror option in gcc?
it avoids all the errors present in the source code
it makes all warnings into errors
it stores all the errors of source code into a seperate file
none of the mentioned
32. The command “as -o sanfoundry.o sanfoundry.s” will
generate object file sanfoundry.o
provide an error if sanfoundry.s exists
generate object file sanfoundry.o & provide an error if sanfoundry.s exists
none of the mentioned
33. The command “gcc -save-temps sanfoundry.c” will generate
sanfoundry.i
sanfoundry.s
sanfoundry.o
all of the mentioned
34. The -H option of gcc
prints the name of each header file used
is used to include header file
ignores the header file which are not required by source code
none of the mentioned
35. Which option of gcc enables compiler’s all warning messages?
-Wall
-War
-Warn
none of the mentioned
36. Which option of gcc adds include directory of header files?
-i
-I
-e
-E
37. The -fPIC option of gcc
generates the position independent code of shared libraries
opens the source file in readonly mode
opens the source file
none of the mentioned
38. The -shared option of gcc generates shared ______ for shared library.
object file
preprocessed file
source file
none of the mentioned
39. Which option of gcc links with a library file?
-l
-L
-e
none of the mentioned
40. Which option of gcc looks in the provided directory for library files?
-l
-L
-link
none of the mentioned
41. The command “cpp sanfoundry.c > sanfoundry.i” will
create the expanded source code file sanfoudry.i for the source code file sanfoundry.c
append the content of the sanfoundry.c into sanfoundry.i
give an error
none of the mentioned
42. Which option of gcc makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes?
-p
-P
-q
-Q
43. The -Wextra option of gcc
is same as -w option
does not exist
enables extra warning messages
none of the mentioned
44. Which gcc option undefines a preprocessor macro?
-U
-u
-undefine
none of the mentioned
45. Pipes are used rather than temporary files for communication between the various stages of compilation in gcc when
-pipe option is used
-temp option is used
–disable -temp option is used
none of the mentioned
46. The gcc option -Wunused warns when a _____ variable is unused aside from its declaration.
variable
function
macro
none of the mentioned
47. Which one of the following is not true?
source codes can not be compiled with static libraries in gcc
-O is used for optimization in gcc
source codes can be compiled
none of the mentioned
48. The command line options of gcc can also be read from a file with
@
$
#
none of the mentioned
49. Which option of the gcc is used to warn is padding is included in structure?
-Wpadded
-Wpad
-Wpadding
None of the mentioned
50. Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?
-time
-cpu
-process
none of the mentioned
Submit