Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Recursive Function

8. Chapter 6 , “C Control Statements: Looping,” ( Listing 6.20 ) shows a power() functionthat 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 thefunction that 0 to any power other than 0 is 0 and that any number to the 0 power is 1.(It should report that 0 to the 0 is undefined, then say it’s using a value of 1.) Use a loop.Test the function in a program.9. Redo Programming Exercise 8, but this time use a recursive function.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question