Find area of circle in C++ by R4R Team

Area of circle:
area=3.14*r%r;
-Here r is the radius of the circle.

program:

#include< iostream>
class r4r
{
public:
int find_area(int radius)
{
int area;
area=3.14*radius*radius;
cout<<"Area of Circle is "<< area;
}
};
int main() {
int r;
r4r obj;
cout<<"Enter radius"<< endl;
cin>>r;
obj.find_area(r);
}


output-

Enter radius
3
Area of Circle is 28.260000

-In this program, we take an input in variable 'r' that is radius of circle.
-Then apply formula for area of circle and store that value in variable 'area'.
-And at last display that area.




Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!