Guest User

Untitled

a guest
Jan 21st, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. int main()
  2. {
  3. const double MY_PI = 3.14159265;
  4. double radius;
  5. cout << "Program calculates the area and circumference of a circle" << endl;
  6. cout << "enter circle radius" << endl;
  7. cin >> radius;
  8. double area = MY_PI*(radius*radius);
  9. double circumference = 2*MY_PI*radius;
  10.  
  11. //these are the lines with errors
  12. double AREA_STR = "Area of circle with radius " + radius + " is " + area;
  13. double CIRCUM_STR = "Circumference of a circle with radius " + radius + " is " + circumference;
  14.  
  15. cout << AREA_STR << endl;
  16. cout << CIRCUM_STR << endl;
  17.  
  18. return 0;
Add Comment
Please, Sign In to add comment