What is pow() Function?
The pow() function is used to calculate the exponential power of a given number. The declaration of pow() function is as follows:double pow (double, double);
The declaration of pow() function indicates that two parameters both of "double" types are passed to this function. The output returned by this function is also of "double" type.The general syntax to call this function is as follows:
var = pow (x, y);
In the above syntax:x
It indicates a value whose exponential power is to be calculated. It may be a variable, constant value or expression.y
It indicates a value to be used as exponential power.var
It indicates the variable of "double" type into which the returned vale is to be stored.The following statement will calculate 2^3 and display the result on the screen.
cout