Advertisement
WiktoriaRatajczyk

Zadanie 9

Mar 23rd, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int POTEGA (int x, int y) {
  6.     int i;
  7.     int w=1;
  8.     for (i=0;i<y;i++) {w=w*x;}
  9.         return w;
  10.     }
  11.  
  12. int main()
  13. {
  14.     cout<<"Potega liczb wynosi: "<<POTEGA(2,4)<<endl;
  15.     cout<<"Potega liczb wynosi: "<<POTEGA(3,3)<<endl;
  16.     cout<<"Potega liczb wynosi: "<<POTEGA(1,11)<<endl;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement