250+ TOP MCQs on Various Options -1 and Answers

Linux / Unix questions and answers focuses on various options used in compilation with gcc. This is set 1.1. Which one of the following command creates the executable file a.out?
a) gcc -o .c
b) gcc .c
c) gcc -o a.out
d) gcc a.out

Answer: b
Clarification: None.

2. If we compile the sanfoudry.c file with the command “gcc -o .c”, then the executable file will be
a) a.out
b)
c) .out
d) none of the mentioned

Answer: b
Clarification: None.

3. If we compile the .c file with the command “gcc -c .c”, then the output file will be
a) .o
b) .s
c) .i
d) none of the mentioned

Answer: a
Clarification: None.

4. Which gcc option includes debugging info in the generated object code?
a) -g
b) -c
c) -p
d) none of the mentioned

Answer: a
Clarification: None.

5. The command “gcc -S .c” will
a) stop compilation process after the generation of assembly code file
b) generate .s file
c) stop compilation process after the generation of assembly code file & generate .s file
d) none of the mentioned

Answer: c
Clarification: None.

6. Which gcc option stops compilation process after preprocessing stage?
a) -e
b) -f
c) -E
d) -F

Answer: c
Clarification: None.

7. The -v option of gcc
a) print the commands executed to run the stages of compilation
b) version of the gcc compiler
c) all of the mentioned
d) none of the mentioned

Answer: a
Clarification: None.

8. Which gcc option turns off certain features of gcc that are incompatible with ISO C89?
a) -ansi
b) -ISO
c) -ver
d) none of the mentioned

Answer: a
Clarification: None.

9. The option -fsyntax-only of gcc
a) checks the code for syntax error
b) checks the code for fatal error
c) checks the code for syntax & fatal error
d) none of the mentioned

Answer: a
Clarification: None.

10. Which option of gcc inhibit all warning messages?
a) -w
b) -x
c) -y
d) -z

Answer: a
Clarification: None.

Leave a Reply

Your email address will not be published. Required fields are marked *