ExamVeda
Login
Home
This question belongs to MySQL MySQL Miscellaneous
MySQL Miscellaneous
?

The option necessary to compile a C program havin math functions is . . . . . . . .

Answer & Solution
Correct Answer: Option A
This question is about compiling C programs that use mathematical functions.
When you compile a C program, you need to link it with libraries that contain the necessary functions.
The -lm option tells the compiler to link the program with the math library.
This library includes functions like sqrt, sin, cos, and others for mathematical operations.
So the correct answer is Option A: -lm.
Let's look at why the other options are incorrect:
* Option B: -ln: This option is not related to the math library, it's likely used for other purposes.
* Option C: -lp: This option usually links to the standard C library, which contains basic functions but not the math functions.
* Option D: -lq: This option is not a standard library option in C programming.
Therefore, to compile a C program with mathematical functions, you need to use -lm to link the math library.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.