# C++ Program to Calculate Area and Circumference of Circle

The area of a circle is the number of square units inside that circle. The formula for calculation of area of circle  is:

### Area=πr²

In above formula,  “r” shows the radius of circle while “π” is a Greek letter pronounced as PI. it is a ratio of circumference of a circle to the diameter. its value is constant which is 3.14.

The circumference of a circle is the distance around that circle. The formula for calculation of circumference is:

## C++ Code to Calculate Area and Circumference of Circle:

``````#include<iostream>
using namespace std;
int main()
{
float PI=3.14;
cout<<"Area of circle: "<<area<<endl;
cout<<"Circumference of circle: "<<circum;
return 0;
}```
```

## Code Explanation:

The above program is used to calculate the area and circumference of a circle for a given radius.

This program is based upon float type variables as we want the program to work with numbers containing decimal points. First we declared PI variable and initialized it to 3.14 so it will work as constant for whole program. Then we declared three more variables. One for user input and two for storing results.

Recommended reading: Program To Find Area and Perimeter of Rectangle in C++

As program starts its execution, it asks the user to enter the radius of circle and  stores the input in float type variable radius. After that it calculates area and circumference of circle. In the form of C++ coding,  the formulae for area and circumference of circle are as follows: