Advertisement
Kacper_Michalak

Zadanie pętle 7

Dec 12th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x;
  7.     float P=0,OBW=0;
  8.     do
  9.     {
  10.         cout << "Podaj dlugosc promienia kola" << endl;
  11.         cin >> x;
  12.     } while (x <= 0);
  13.  
  14.     P = 3.14 * x;
  15.     OBW = 3.14 * (2*x);
  16.  
  17.     cout << "Obwod kola wynosi: " << OBW << endl;
  18.     cout << "Pole kola wynosi: " << P << endl;
  19.  
  20.    
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement