I am new on programming, is currently using dev c++. I was asked to write a method to find x^y, where y is a power of x. Using recursive and iterative solution. I already have the recursive one, but I don't know how to make it to iterative. Here is my recursive solution.
Help would highly be appreciated. Thanks in advance..
int power (int, int);
int main ()
int base, exp, result;
printf("Please enter a base number\n");
printf("Please enter a exponent number\n");
result = power(base, exp);
printf("\n The result is:%d\n",result);
int power (int base, int exp)
if(exp >= 1)
return base * (power(base,exp - 1));