Really, I did not know that. What is the reason for it? I am trying to visualize it using Assembly code but the recursive function not being optimal really depends on how the assembly code is being written. Shows that you learn something new everyday!
@pracas. here is a non recursive function:
int powint(int x, int y)
{
int val=x;
for(int z=0;z<=y;z++)
{
if(z==0)
val=1;
else
val=val*x;
}
return val;
}