Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 47: Write a C++ program to calculate the power of a number using recursion.

using namespace std;

int power(int base,int num)
		return base;
		return base*power(base,num-1);

int main()
	int base,num;
	cout<<"\nenter the base and power : ";
	cout<<"\nresult : "<<power(base,num);
	return 0;

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.