Skip to main content
ICT
Lesson A9 - Recursion
 
Main   Previous Next
 

C. Recursion Practice page 5 of 8

  1. To provide some practice, write a recursive power method that raises a base to some exponent, n. Use integers to keep things simple.

    // Recursively determines base raised to
    // the nth power. Assumes 0 <= n <= 10.
    double power( int base, int n )
    {

     

     

     

    }

 

Main   Previous Next
Contact
 © ICT 2006, All Rights Reserved.