1 Crore+ students have signed up on EduRev. Have you? |
Which header file is required for manipulation of math functions in c++?
#include is a header file required for manipulation of math functions.
What will be the output of the following C++ code?
#include <stdio.h>
#include <math.h>
int main ()
{
int param, result;
int n;
param = 8.0;
result = frexp (param , &n);
printf ("%d \n", param);
return 0;
}
In this program, We are breaking out the number by using the frexp function.
Output:
$ g++ math.cpp
$ a.out
8
What will be the output of the following C++ code?
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("%lf", pow (7.0,3));
return 0;
}
In this program, We are calculating the 7 power of 3 by using the powfunction. As we are using 7.0, it is producing the result in 343.00
Output:
$ g++ math2.cpp
$ a.out
343.000000
What will be the output of the following C++ code?
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("%lf", fabs (-10.6) );
return 0;
}
In this program, We are finding the absolute value of -10.6 by using abs function.
Output:
$ g++ math4.cpp
$ a.out
10.600000
There are two parameters that are used in frexp function. They are floating point value to be computed and pointer to an int object.
With which does the trigonometric functions work with angles in c++?
The trigonometric functions work with angles in radians rather than degrees.
How many macros are used by mathematical functions in the header file <cerrno>?
There are three macros used in mathematical functions. They are HUGE_VAL, EDOM, ERANGE.
What will be the output of the following C++ code?
#include <stdio.h>
#include <math.h>
int main ()
{
double param, result;
param = 5.5;
result = log (param);
printf ("%lf", result );
return 0;
}
In this program, We are finding out the log value of param by using param function.
Output:
$ g++ math1.cpp
$ a.out
1.704748
What will be the output of the following C++ code?
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("%lf\n", fmod (5.3, 2) );
printf ("%lf\n", fmod (18.5, 4.2) );
return 0;
}
In this program, We are finding the remainder of the given values by using fmod function.
Output:
$ g++ math3.cpp
$ a.out
1.300000
1.700000
Which of the following mathematical function is overloaded in <complex> and <valarray>?
Because tan has more different definition in normal case and in case of complex number i.e. tan = sin/cos(normally) and tan = y/x in complex numbers.
15 videos|20 docs|13 tests
|
Use Code STAYHOME200 and get INR 200 additional OFF
|
Use Coupon Code |
15 videos|20 docs|13 tests
|
|
|
|
|
|
|
|
|
|