Advertisement
Spocoman

08. Circle Area and Perimeter

Sep 1st, 2023 (edited)
616
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     double radius;
  7.     cin >> radius;
  8.  
  9.     double area = 3.14159265359 * radius * radius;
  10.     double perimeter = 2 * 3.14159265359 * radius;
  11.    
  12.     cout.setf(ios::fixed);
  13.     cout.precision(2);
  14.  
  15.     cout << area << endl;
  16.     cout << perimeter << endl;
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement