Which of the following function invocations is an approximat
Which of the following function invocations is an approximation of PI atan(-1); acos(-1); sin(-1); cos (-1); none of these To use mathematical functions like squareroot , you need to # include what file?
Solution
13) acos(-1) gives the pi approximation
acos() is inverse of cos(), for x=-1, acos(x) will give the the result pi radians i.e 3.14159
14) math.h
Header <cmath> declares a set of functions to compute common mathematical operations and transformations:
math.h is a C library header. Its use is deprecated, but allowed in C++.
cmath is a C++ library header. It has the stuff from math.h in the correct namespace plus a lot more .
So the correct option is cmath
