Simple integer power function in C

int power(int a, int b){
int result=0;
int i=0;
do{
if (i==0){result=1;}
else {
result = result * a;
}
i++;
}
while(i<=b);
return result;
}

Leave a Reply

Your email address will not be published. Required fields are marked *