#include<iostream> using namespace std; class Circle { private: double radius; public: void setradius( double R ) { radius = R; } double getradius() const { return radius; } double getArea() const { return 3.14*radius*radius; } }; int main() { Circle C; double cradius; cout<<"Enter the radius of the circle:"; cin>>cradius; C.setradius(cradius); cout<<"Here is the circle's data:"<<endl; cout<<"radius : "<<C.getradius()<<endl; cout<<"Area : "<<C.getArea()<<endl; system("pause"); }
Subscribe to:
Post Comments (Atom)
Post A Comment:
0 comments: