Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.  
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. //Initializes the main function
  7. int main()
  8. {
  9.     double rad{0.0};
  10.     double circ{0.0};
  11.     double diam{0.0};
  12.     double area{0.0};
  13.     double pi{3.14159};
  14.  
  15.     cout << "Radius? " << endl;
  16.     cin >> rad;
  17.  
  18.     //Defining the variables
  19.     circ = 2 * pi * rad;
  20.     diam = 2 * rad;
  21.     area = pi * (rad * rad);
  22.  
  23.     //Output for the user
  24.     cout << "Circumference is " << circ << endl;
  25.     cout << "Diameter is " << diam << endl;
  26.     cout << "Area is " << area << endl;
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement