Which of the following are correct invocations for the pow function? If any of the following is correct, give the value returned or assigned, and if apparently incorrect, explain.
Given the following include directive (to get the declaration for the pow function from the math library):
```
#include
```
Now make these declarations:
double base = 2, exponent = 3, power = 4;
a) power = pow(base, exponent);
b) pow(power, base, exponent);
c) pow(base, exponent) = power;
d) base = pow(exponent, power);
a) power = pow(base, exponent);
b) incorrect, too many arguments for the pow function.
c) incorrect, attempts to assign to power to pow(base, exponent) which is not an l-value, that is, it is not possible to assign a value to this object.
d) is correct. base is assigned the value of 3 to the power 4, 81. Correctness does not depend on variable names. However, these are strange names for the arguments for the pow function. There is very likely an intent error.
You might also like to view...
When you select more than one worksheet in a workbook, the word [Group] appears in the ________ bar
Fill in the blank(s) with correct word
User interface that allows users to switch between various forms and reports in a database.
What will be an ideal response?