Redefine the function power so that it also works for negative exponents. In order to do this, you will also have to change the type of the value returned to double. The function declaration and...



Redefine the function power so that it also works for negative exponents.


In order to do this, you will also have to change the type of the value


returned to double. The function declaration and header comment for the


redefined version of power is as follows:


double power(int x, int n);


//Precondition: If n <>


//Returns x to the power n.


(Hint: x–n is equal to 1/(xn).)



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here