Question: Exercise 8.Chapter 6,C Control Statements: Looping (listing 6.20) shows a power () function that returned the result of raising a type double number to
Exercise 8.Chapter 6,"C Control Statements: Looping " (listing 6.20) shows a power () function that returned the result of raising a type double number to a positive integer value. Improve the function so that it correctly handles negative powers .Also build into the function that 0 to any power other than 0 is 0and that any number that to the 0 power is 1.(it should report that 0 to the 0 is undefined ,then say it's using a value of1.) Use a loop.
Redo exercise 8,but this time use a recursive function
Also add screenshots
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
