Unix/Lunux/Linux Mcqs Questions Set 9 Sample Test,Sample questions

Question:
As we type “make” command on the terminal

1.make reads the makefile in the current directory

2.make reads the makefile in the parent directory

3.make reads the makefile in the predefined environment variable

4.none of the mentioned


Question:
 Which option of gcc enables compiler’s all warning messages?

1.-Wall

2.-War

3.-Warn

4.none of the mentioned


Question:
hat is the job of -Werror option in gcc?

1.it avoids all the errors present in the source code

2.it makes all warnings into errors

3.it stores all the errors of source code into a seperate file

4.none of the mentioned


Question:
If make command is executed as “make -j 2”, then

1.two jobs will run simultaneously

2.only two will be executed

3.it will give an error

4.none of the mentioned


Question:
If our makefile is named as “sanfoundry”, then which one of the following command will compile the code with this makefile

1.make -a sanfoundry

2.make -f sanfoundry

3.make sanfoudry

4.make


Question:
If we compile the sanfoudry.c file with the command “gcc -o sanfoundry sanfoundry.c”, then the executable file will be

1.a.out

2.sanfoundry

3.sanfoundry.out

4.none of the mentioned


Question:
If we compile the sanfoundry.c file with the command “gcc -c sanfoundry.c”, then the output file will be

1.sanfoundry.o

2.sanfoundry.s

3.sanfoundry.i

4.none of the mentioned


Question:
If we want to execute the makefile by just giving the “make” command, makefile should be named as

1.Makefile

2.makefile

3.MAKEFILE

4.None of the mentioned


Question:
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

1.-q

2.-r

3.-s

4.-t


Question:
In makefile the comment begins with the character

1.$

2.#

3./*

4.none of the mentioned


Question:
In the makefile the target and dependencies are separated by the character

1.–

2.:

3. /

4.none of the mentioned


Question:
Macros for the makefile can be defined in

1.makefile

2.command line

3.both makefile and command line

4.none of the mentioned


Question:
Pipes are used rather than temporary files for communication between the various stages of compilation in gcc when

1.-pipe option is used

2.-temp option is used

3.–disable -temp option is used

4.none of the mentioned


Question:
Running “make” command without the arguments starts the target ____ in the makefile.

1.“.phony”

2.“clean”

3. first

4.none of the mentioned


Question:
The -fPIC option of gcc

1.generates the position independent code of shared libraries

2.opens the source file in readonly mode

3.opens the source file

4.none of the mentioned


Question:
The -H option of gcc

1.prints the name of each header file used

2.is used to include header file

3. ignores the header file which are not required by source code

4.none of the mentioned


Question:
The -shared option of gcc generates shared ______ for shared library.

1.object file

2.preprocessed file

3.source file

4.none of the mentioned


Question:
The -v option of gcc

1.print the commands executed to run the stages of compilation

2.version of the gcc compiler

3.all of the mentioned

4.none of the mentioned


Question:
The -Wextra option of gcc

1.is same as -w option

2.does not exist

3.enables extra warning messages

4.none of the mentioned


Question:
The command “as -o sanfoundry.o sanfoundry.s” will

1.generate object file sanfoundry.o

2.provide an error if sanfoundry.s exists

3.generate object file sanfoundry.o & provide an error if sanfoundry.s exists

4.none of the mentioned


Question:
The command “cpp sanfoundry.c > sanfoundry.i” will

1.create the expanded source code file sanfoudry.i for the source code file sanfoundry.c

2.append the content of the sanfoundry.c into sanfoundry.i

3.give an error

4.none of the mentioned


Question:
The command “gcc -S sanfoundry.c” will

1.stop compilation process after the generation of assembly code file

2.generate sanfoundry.s file

3.stop compilation process after the generation of assembly code file & generate sanfoundry.s file

4.none of the mentioned


Question:
The command “gcc -save-temps sanfoundry.c” will generate

1.sanfoundry.i

2.sanfoundry.s

3.sanfoundry.o

4.all of the mentioned


Question:
The command “make sanfoundry” will

1.create the executable if sanfoundry.c file is present in the current directory

2.create the object file named as sanfoundry.o

3.give an error

4.none of the mentioned


Question:
The command line options of gcc can also be read from a file with

1.@

2.$

3.#

4.none of the mentioned


Question:
The gcc option -Wunused warns when a _____ variable is unused aside from its declaration.

1.variable

2.function

3.macro

4.none of the mentioned


Question:
The makefile starts executing from

1.first target

2.first target whose name starts with “.”

3.first target whose name does not starts with “.”

4.none of the mentioned


Question:
The option -fsyntax-only of gcc

1.checks the code for syntax error

2. checks the code for fatal error

3.checks the code for syntax & fatal error

4.none of the mentioned


Question:
What is makefile?

1.makefile describes to the make command that how to compile the program

2.makefile contains various statements related with the compilation of target

3.makefile contains various statements

4.none of the mentioned


Question:
What is phony target in the makefile?

1.the target which is not a filename

2.the target which is a filename

3.the target which does not used for compilation

4.none of the mentioned


Question:
When a target of makefile fails to execute

1.make does not executes any other target dependent on it

2.it returns a status

3.make does not executes any other target dependent on it & it returns a status

4.none of the mentioned


Question:
Which gcc option includes debugging info in the generated object code?

1.-g

2.-c

3.-p

4.none of the mentioned


Question:
Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?

1.-time

2. -cpu

3.-process

4.none of the mentioned


Question:
Which gcc option stops compilation process after preprocessing stage?

1.-e

2.-f

3.-E

4.-F


Question:
Which gcc option turns off certain features of gcc that are incompatible with ISO C89?

1.-ansi

2.-ISO

3.-ver

4.none of the mentioned


Question:
Which gcc option undefines a preprocessor macro?

1.-U

2.-u

3.-undefine

4.none of the mentioned


Question:
Which make command option ignores all errors in commands executed to remark files?

1.-i

2.-j

3.-k

4.None


Question:
Which one of the following can be used to specify the directory to search the dependencies and target files?

1.VPATH

2.CPATH

3.FPATH

4.None of the mentioned


Question:
Which one of the following command creates the executable file a.out?

1.gcc -o sanfoundry.c

2.gcc sanfoundry.c

3.gcc -o a.out

4.gcc a.out


Question:
Which one of the following is not a valid makefile directive?

1. if

2.elif

3.endif

4. none of the mentioned


Question:
Which one of the following is not true?

1.source codes can not be compiled with static libraries in gcc

2. -O is used for optimization in gcc

3.source codes can be compiled

4.none of the mentioned


Question:
Which one of the following is used for the target filename in the makefile?

1.$@

2.$*

3.$?

4.none of the mentioned


Question:
Which one of the following provides all dependencies in the makefile?

1.$^

2.$*

3.$:

4.none of the mentioned


Question:
Which option of gcc adds include directory of header files?

1.-i

2.-I

3.-e

4.-E


Question:
Which option of gcc inhibit all warning messages?

1.-w

2.-x

3.-y

4.-z


Question:
Which option of gcc links with a library file?

1.-l

2.-L

3.-e

4.none of the mentioned


Question:
Which option of gcc looks in the provided directory for library files?

1.-l

2.-L

3.-link

4.none of the mentioned


Question:
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?

1.-p

2.-P

3.-q

4.-Q


Question:
Which option of make command print the commands that would be executed, but do not execute them?

1.-m

2.-n

3.-o

4.-p


Question:
Which option of the gcc is used to warn is padding is included in structure?

1.-Wpadded

2.-Wpad

3.-Wpadding

4.None of the mentioned


More MCQS

  1. Unix MCQS Set 1
  2. Unix MCQS Set 2
  3. Unix MCQS Set 3
  4. Unix MCQS Set 4
  5. Linux Mcqs Questions Set 1
  6. Linux Mcqs Questions Set 2
  7. Linux Mcqs Questions Set 3
  8. Linux Mcqs Questions Set 4
  9. Linux Mcqs Questions Set 5
  10. Linux Mcqs Questions Set 6
  11. Linux Mcqs Questions Set 7
  12. Linux Mcqs Questions Set 8
  13. Linux Mcqs Questions Set 9
  14. Linux Mcqs Questions Set 10
  15. Linux Mcqs Questions Set 11
  16. Linux Mcqs Questions Set 12
  17. Linux Mcqs Questions Set 13
  18. Linux Mcqs Questions Set 14
  19. Unix MCQ Set 01
  20. Unix MCQ Set 02
  21. UNIX SYSTEM Mcq
  22. Unix MCQ
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!