Tuesday, October 12, 2010

Recursive function to calculate a^b (a power of b)

int mypower(int a, int b)
{
if (b==0)
   return 1;
else
     return (a * mypower (a,b--));
}