#include <iostream.h>
#include <conio.h>
// start class
class circle
{
private :
float radius;
float x , y;
public :
void get_radius(float r)
{ radius = r; }
void get_xycoor(float a, float b)
{ x = a;
y = b;
}
void area( )
{
cout<< "\n\n The area of the circle of radius "<< radius <<" is " << 3.14 * radius * radius ;
}
void circum()
{
cout<< "\n\n The circumference of the circle of radius "<< radius <<" is " << 2 *3.14 * radius ;
}
};
//End of class
void main()
{
circle c1;
float rad;
cout<< "\n Enter radius :";
cin >> rad;
c1.get_radius(rad);
c1.area();
c1.circum();
getch();
}
No comments:
Post a Comment