#include #include #include using namespace std ; int powerRecursive( int base, int power ) { //TO DO // base to power = base * base to (power -1 ) return ( 1 ) ; } int powerIterative( int base, int power ) { if ( power == 0 ) return 1 ; if ( power == 1 ) return base ; int result = base ; for(int i1 = 1 ; i1 < power ; i1++ ) { result = result * base ; } return result ; } int main() { cout << powerIterative(2, 4) << endl ; cout << powerRecursive(2, 4) << endl ; }