Guest User

Untitled

a guest
Jul 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. int power( int base, int expo, int result = 0 )
  2. {
  3.     if ( result == 0 )
  4.     result = base;
  5.    
  6.     if ( expo > 0 )
  7.     result = power( base, expo - 1, base * result );
  8.  
  9.     return result;
  10. }
Add Comment
Please, Sign In to add comment