SyntaxFix
Write A Post
Hire A Developer
Questions
I use recursive, if the exp is even,5^10 =25^5.
int pow(float base,float exp){ if (exp==0)return 1; else if(exp>0&&exp%2==0){ return pow(base*base,exp/2); }else if (exp>0&&exp%2!=0){ return base*pow(base,exp-1); } }