You are here

Area of a circle in C

C program to find the area of a circle: C programming code to calculate the area of a circle. In the program, Pi (ϖ) is assumed to be 3.14159.

Area of a circle program in C

#include <stdio.h>
#include <math.h>

int main()
{
  float radius, area;

  printf("Enter the radius of a circle\n");

  scanf("%f", &radius);

  area = 3.14159*radius*radius;

  printf("Area of the circle = %.2f\n", area);  // printing upto two decimal places

  return 0;
}

Share this