Q) Which statement will you add in the following program to work it correctly?
#include<stdio.h>
int main()
{
printf("%f\n", log(36.0));
return 0;
}
A. #include<conio.h> B. #include<math.h>
C. #include<stdlib.h> D. #include<dos.h>
Explanation:
math.h is a header file in the standard library of C programming language designed for basic mathematical operations. Whenever Mathematical operation is to be performed then math.h is need to included to execute the program.
Declaration syntax: double log(double);
which means it accepts double type variable as input and return double type result. In the above program it takes 36.0 as input which is double and it will return double data.
No comments:
Post a Comment