Vidyalelo
MySQL · Q829

MySQL

Programming · MySQL · question 829

Q829

Which option is used for specifying the executable name while compiling with gcc?

A.
-e
B.
-o
Answer
C.
-a
D.
-b

Answer: Option B

Solution

Answer: Option B
Solution:
This question is about compiling programs using the gcc compiler. When you compile a program, you need to tell the compiler what you want the final executable file to be called.

The -o option is used to specify the executable name. So, the correct answer is Option B.

Let's break it down further:

- gcc is the command used to compile programs in C and C++.
- -o is a flag that tells the compiler the name of the output executable file.

For example, to compile a program called myprogram.c and create an executable called myprogram, you would use this command:
gcc myprogram.c -o myprogram
The other options are not used for specifying the executable name:
- -e is used for defining an environment variable.
- -a is not a valid flag for the gcc compiler.
- -b is not a valid flag for the gcc compiler.