Write a recursive function named power()that takes two integers as arguments. The function finds the value of the first integer raised to the power of the second integer. Base your recursive function...



Write a recursive function named power()that takes two integers as arguments. The


function finds the value of the first integer raised to the power of the second integer.


Base your recursive function on the knowledge that for any two numbers x and n, xn = x *


xn–1. Write a main()function that demonstrates that the power()function works


correctly. Save the file as Power.cpp.


10. Write a recursive function that calculates the factorial of its integer argument. Base


your recursive function on the knowledge that for any number n, the value of n


factorial (usually written as n!) is n * (n – 1) * (n – 2) * (n – 3). . . .* 1. Write a main()


function that demonstrates that the function works correctly. (On many systems,


you must use a value of 16 or lower to achieve correct results; the factorial of higher


numbers is larger than the value that can be stored in an integer.) Save the file as


Factorial.cpp.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here