Glenpl

Untitled

Nov 5th, 2014
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. #define M_PI  3.14159265359
  6. #define M_2PI 6.28318530718
  7.  
  8. inline long double pole_okregu(long double r)
  9. {
  10.     return M_PI * (r*r);
  11. }
  12.  
  13. inline long double obwod_okregu(long double r)
  14. {
  15.     return M_2PI * r;
  16. }
  17.  
  18. int main()
  19. {
  20.     long double promien;
  21.     cout << "Podaj promien okregu: ";
  22.     cin >> promien;
  23.     cout << endl;
  24.  
  25.     cout << "Pole okregu o podanym promieniu wynosi: " << pole_okregu(promien);
  26.     cout << endl << endl;
  27.     cout << "Obwod okregu o podanym promieniu wynosi: " << obwod_okregu(promien);
  28.  
  29.     cout << endl << endl;
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment