-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass-Circle.cpp
More file actions
42 lines (41 loc) · 807 Bytes
/
Class-Circle.cpp
File metadata and controls
42 lines (41 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
**************************
Program Name :: Class Circle
Program Description :: In this Program we declare class Circle obj data member Radius(r)
And Three Member Function get _ Radius() , Area() & Circum().
Program Date :: May 29,2023
Program Author :: Habiba
**************************
*/
#include <iostream>
using namespace std;
class Circle
{
private:
float radius ;
public:
void get_radius(float r)
{
radius =r;
}
void area()
{
cout<<"\nArea of circle :"<<3.14*radius*radius;
}
void circum()
{
cout <<"\n Circumference of circle :"<< 2 * 3.14 * radius ;
}
};
int main()
{
system ("cls");
Circle c1;
float rad;
cout<<"\nEnter radius :";
cin>>rad;
c1.get_radius(rad);
c1.area();
c1.circum();
return 0;
}