# C Program to Find the Area of Circle using Function

In this article, we will write a C program to find the area of circle using function.

The program takes the radius of the circle from the user as input and prints the circle’s area as an output on the screen.

Sample Input:

``Enter the Radius of the Circle: 2``

Output:

``The Area of the Circle is: 12.560000``

The formula of a circle having radius r is given by:

Where π is a constant having a value of 22/7 or 3.14

The following program shows how you can calculate the area of a circle using a function in C programming language:

```// C program to calculate the area of a circle
#include <stdio.h>

// User defined function to calculate circle's area

const float PI = 3.14;
float area;

// Calculate the area

return area;  // Return the area

}

int main(){

// Declare the variables

printf("Enter the Radius of the Circle: ");

// call the function

// Print the result
printf("The Area of the Circle is: %f", circleArea);

return 0;

}```

Output:

```Enter the Radius of the Circle: 2
The Area of the Circle is: 12.560000```

### Code Explanation:

• The program asks the user to input the radius of the circle which is stored in the `radius` variable.
• To calculate the area of the circle, we call the `getCircleArea()` function which takes the radius of the circle as an argument and returns the calculated area.
• The value returned by the `getCircleArea()` function is stored in the `circleArea` variable.
• Finally, the area of the circle is printed on the screen using the printf() function.

• 