Advertisement
Md_Touhid

URI - Problem 1002 - Area of a Circle

Apr 11th, 2020
271
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 <iomanip>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     double A, n=3.14159, R;
  9.  
  10.     cin >> R;
  11.  
  12.     A = n * R * R;
  13.  
  14.     cout << "A=" << fixed <<setprecision(4) << A << endl; //setting 4 digits after decimal point. needs "iomanip"
  15.  
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement