Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int POTEGA(int x, int y);
- int main(){
- cout << POTEGA(2, 6) << endl;
- cout << POTEGA(2, 2) << endl;
- cout << POTEGA(4, 3) << endl;
- cout << POTEGA(4, 5) << endl;
- }
- int POTEGA(int x, int y){
- int z = x;
- for (int i = 1; i < y; i++) z *= x;
- return z;
- }
Advertisement
Add Comment
Please, Sign In to add comment