#include <iostream>
using namespace std;
class Circle {
private:
double radius;
public:
Circle() {
radius = 1;
}
Circle(double r) {
radius = r;
}
double getArea() {
return 3.141592 * radius * radius;
}
};
int main() {
Circle c1;
Circle c2(3);
cout << "c1: " << c1.getArea() << endl;
cout << "c2: " << c2.getArea() << endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: