12. Calculate Exponent
Lesson 13 of 31 in Coddy's 30 Days of Logic Building in C++ course.
Challenge
EasyWrite a function to calculate the exponentiation of a number.
- Input: 2, 4
- Output: 16 (2 x 2 x 2 x 2)
Try it yourself
int calculateExponent(int base, int exponent) {
// Write code here
}All lessons in 30 Days of Logic Building in C++
1Introduction
Introduction