
Lesson 13A-2: Simple Variables
316 | Chapter 13A
Name __________________________________________ Date _______________________
Section _________________________________________
Exercise 1: C++ does not have an exponential operator. Write the recursive value-returning
function Power that takes two parameters (number and exponent) and returns number multiplied
by itself exponent times. That is, Power returns the result of number
exponent
. Run a driver
program that calls Power(7,3) and prints the result.
What is printed?
Exercise 2: The Fibonacci numbers are defined as the following sequence:
0 1 1 2 3 5 8 13 21 34 55 ...
Notice that except for the first two ...