 # PHP Program to find the Area and Circumference of the circle

August 4, 2021, Learn eTutorial
995

## Area and Circumference of the circle

There are mathematical formulas to find the area and circumference of the circle. To find the area of a circle first we have to get the radius of the circle and use the formula `πpi r2 `and to find the circumference we use the formula 2`&pi r.` For example, if the radius of the circle is 7 then the area of the circle will be `π * 72 `which will be 153.938 and circumference will be 2 * `π * 7 `which will be 43.982.

## How to find the area and circumference using PHP

In PHP there are many ways to find the area and circumference of the circle in this program we are using the built-in functions `pi()` for the pi(3.14) value and `pwo()` to find the power of the value and we are also using the `round() `to limit the number of digits after the decimal point. First, we have to read the radius from the user and assign it to a variable, and to find the area we have to use the formula `pi() * pow(radius, 2) `and to find the circumference we have to use the formula `2 * pi() * radius.`

### `ALGORITHM `

Step 1: Accept the radius from the user and assign it to a variable radius

Step 2: Compute the operation to find the area 'pi() * pow(radius, 2)' and assign the value to the variable area

Step 3: Compute the operation to find the circumference '2 * pi() * radius' and assign the value to the variable circumference

Step 4: Print the values of the variable area and circumference as the area and circumference of the circle

## PHP Source Code

```                                          ```<?php
```Enter the radius: 15