Building An Exponent Function
Lesson 23Author : 🦒
Last Updated : November, 2017
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;
}