C++ Program to Find Diameter, Circumference and Area of Circle

Write C++ Program to Find Diameter, Circumference and Area of Circle

// CPP Program to Find Diameter, Circumference and Area of Circle

#include <iostream>
#define PI 3.14

using namespace std;

int main()
{
    float radius, area, diameter, circumference;

    cout << "Enter radius of circle :--> ";
    cin >> radius;

	diameter = 2 * radius;			 // Diameter Formula
	circumference = 2 * PI * radius; //Circumference Formula
    area = PI * radius * radius;     //area of circle Formula

    cout << "\nArea of circle is :--> " << area;
	cout << "\nThe Diameter of the circle is :--> " << diameter;
	cout << "\nThe Circumference of the circle is :--> " << circumference;

    return 0;
}

Output:

Enter radius of circle :--> 12

Area of circle is :--> 452.16
The Diameter of the circle is :--> 24.00
The Circumference of the circle is :--> 75.36

≪ Previous | Next ≫