Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int mathPower(int b, int e) {
- int result = 1;
- for (int i = 0; i < e; i++) {
- result *= b;
- }
- return result;
- }
- int main() {
- int base, exponent;
- cin >> base >> exponent;
- cout << mathPower(base, exponent) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement