#include <iostream>
using namespace std;
int FindPower(int base, int power) {
if (power == 0)
return 1;
else
return (base * FindPower(base, power-1));
}
int main() {
int base = 3, power = 5;
cout<<base<<" raised to the power "<<power<<" is "<<FindPower(base, power);
return 0;
}
#include <iostream>
using namespace std;
int power (int a , int n );
int main()
{
cout << " Please enter number = " ;
int a , n ;
cin >> a ;
cout << " Please enter power = " ;
cin >> n ;
cout << " Answer is = " << power ( a , n );
return 0;
}
int power (int a , int n )
{
if ( n != 0)
return a * power ( a , n -1 );
else
return 1;
}