C Program to Calculate Area Of a Circle

Finding Area of a circle

I am going to tell you about finding an area of a circle in C programming.The area of a circle is number of square units inside the circle. Standard formula to calculate the area of a circle is: A=πr² .where  π =22/7( value is 3.141 )

You can compute the area of a Circle if you know its radius, by simple formula  A = 3.14 * r * r in C programming.We allow user to enter radius, and then find the area of the cirle.

C Program to Calculate Area Of a Circle

Algorithm:-

  1. initialization of radius.

  2. calculate the area of circle  area=3.14*radius*radius.

C Code:-

#include<stdio.h>
int main()
{

//for initialization of radius and area in a float datatype
float radius,area,pi=3.14;

// for use user input

printf("Enter the Radius of a Circle : ");
scanf("%f",&radius);

//formula of area of circle

area = pi*radius*radius;

printf("Area of Circle is: %f",area);
return 0;
}
Output:-
Enter the Radius of a circle: 5
Area of Circle is :78.75