C Programming Code Examples C > Mathematics Code Examples Program to Calculate the Area of a Circle Program to Calculate the Area of a Circle This C Program calculates the area of a Circle given it's radius. The formula to calculate the area is: Area = ? x r2 where r is the radius of the circle & ? value is 22/7. #include <stdio.h> #include <math.h> #define PI 3.142 void main() { float radius, area; printf("Enter the radius of a circle \n"); scanf("%f", &radius); area = PI * pow(radius, 2); printf("Area of a circle = %5.2f\n", area); }