C program to find the area of a circle: C programming code to calculate the area of a circle. In the program, we use 3.14159 as the value of Pi (ϖ). To compute it, we need to know the radius. If we know the diameter or circumference, we find the radius from it. Let's write the program now.
Area of a circle program in C
float radius, area;
printf("Enter the radius of a circle\n");
area = 3.14159*radius*radius;
printf("Area of the circle = %.2f\n", area); // printing upto two decimal places
Output of program:
Function to calculate area of a circle