Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Exercise 2.20
- //This program accepts a radius of a circle and prints the diameter, circumference, and area
- #include <iostream>
- using namespace std;
- int main(){
- int radius{};
- cout << "Please input the radius of your circle: " << endl;
- cin >> radius;
- cout << "Diameter is " << radius * 2 << endl;
- cout << "Circumference is " << 2 * 3.14159 * radius << endl;
- cout << "Area is " << 3.14159 * radius * radius << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement