KonradKonieczny

Funkcje - zadanie 9

Mar 18th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6. int potega (int p, int w)
  7. {
  8.     return pow(p,w);
  9. }
  10.  
  11. int main()
  12. {
  13.     cout << "2^8 = "<<potega(2,8)<<endl;
  14.  
  15.     cout << "3^3 = "<<potega(3,3)<<endl;
  16.  
  17.     cout << "(-1)^2 = "<<potega(-1,2)<<endl;
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment