#include<iostream>
using namespace std;
int recurse(int b,int p)
{
if(p==0)
{
return 1;
}
else if(p==1)
{
return b;
}
else
{
return (b*(recurse(b,p-1)));
}
}
int main()
{
int p,b;
cout<<"enter base"<<endl;
cin>>b;
cout<<"enter the power"<<endl;
cin>>p;
cout<<"power of the number is"<<recurse(b,p);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: