Hi I want to write a code for a pow function without using math.h libary.
How is this code?how can i fix it when b<0
int MyPow(int a,int b){
if(b<0)
return 1 / MyPow (a,-b)
else if(b==0)
return 1;
else if(b==1)
return a;
else
return a*MyPow(a,b-1)
}