so this exercise is in the book i'm using to learn C, and i'm not finding the solution to make it work, this is the code i have rn (not working like it should)
int power(int x, int n)
{
if (n == 0)
return x;
else
{
if(n % 2 == 0)
return x * power(x, n / 2);
else
return x * power(x, n - 1);
}
}