main()
{
double x;
int i;
cout<<"Please enter the number : ";//user prompt to enter the number
cin>>x;
cout<<"Please enter the integer power that you want this number raise to power : ";// user prompt to enter the power times
cin>>i;
cout<<x <<" raise to power " <<i <<"is = " << raiseToPow(x,i);//result
}
//function to calculate the power of some number
double raiseToPow(double x, int power)
{
double result = 1.0;//declare variable and initialize it
int i;
for(i = 0; i < power; i++)//calculate the raise to power
{
result *=x;//same as result = result*x
}
return(result);
}