C++ Program to calculate the diameter, area and circumference of the circle. | सर्कल के व्यास, क्षेत्र और परिधि की गणना करने के लिए C ++ प्रोग्राम।

C++ Program to calculate the diameter,area and circumference of the circle.

Let see the program to calculate the diameter,area and circumference of the circle.

Example:
  1. Formula:

    diameter,area and circumference of the circle
     circle

/* to calculate the diameter of the circle. */ #include <iostream> using namespace std; int main() { double radius,diameter; cout<<"Enter radius of circle :"; cin>>radius; diameter=2*radius; cout<<"diameter of circle = :"<<diameter<<" units."<<endl; return 0; }
Output:
Enter radius of circle :5 diameter of circle = :10 units.
/* to calculate the circumference of the circle. */ #include <iostream> using namespace std; int main() { double radius,circumference; cout<<"Enter radius of circle :"; cin>>radius; circumference=2* (22/7) *radius; cout<<"circumference of circle = "<<circumference<<" units."<<endl; return 0; }
Output:
Enter radius of circle :5 circumference of circle = = 30 units.
/* to calculate the area of the circle. */ #include <iostream> using namespace std; int main() { double radius,area; cout<<"Enter radius of circle :"; cin>>radius; area=(22/7) *radius*radius; cout<<"area of circle = :"<<area<<" sq. units."<<endl; return 0; }
Output:
Enter radius of circle :5 area of circle = :75 sq. units.