What is the return type of log()
Answers
The return type of log() is float
Explanation:
log() function in C
It is one of the Math Functions used in C/C++/Java programming
The log() function in C/C++ programming language will accept single parameter and then returns a value of data type float i.e. natural logarithm (base = e) of a given number, where e represents the exponential number.
C program
#include <stdio.h>
#include <math.h>
int main()
{
double num = 5.6, result;
result = log(num);
printf("log(%.1f) = %.2f", num, result);
return 0;
}
Output
log(5.6) = 1.72
double return type is the return type of log()
Explanation:
- As log is the returns the point number values that's the reason the return type of log() is double.
- In Java programming language the math package holds the log() function There are three cases arises in the log() function.
The output is NAN if the parameter is less then 0.
The output is Positive If the parameter is positive .
The output is Negative If the parameter is negative .
double y 1= -449.939; // variable declaration
Math.log(y1));
Output:Nan
Learn More:
https://brainly.in/question/15315444