Write a function called power that takes a double value


Program

Raising a number n to a power p is the same as multiplying n by itself p times. Write a function called power () that takes a double value for n and an int value for p and returns the result as double value. Use a default argument of 2for p, so that if this argument is omitted the number will be squared. Write a main () function That gets values from the user to test this function.

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a function called power that takes a double value
Reference No:- TGS01475481

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)