Building An Exponent Function
Lesson 23Author : GOUP
Last Updated : September, 2020
Code
int power(int baseNum, powNum){
int result = 1;
for(int i = 0; i < powNum; i++){
result = result * baseNum;
}
return result;
}
int power(int baseNum, powNum){
int result = 1;
for(int i = 0; i < powNum; i++){
result = result * baseNum;
}
return result;
}