Learn about C Program to Find the Circumference of a Circle in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
C Program to Find the Circumference of a Circle
As we all know, a circle is the location of a group of points that constitute the perimeter and are equidistant from a single point in the centre. The circumference of a circle is the circumference of a circle.
All of the points to make up the circle’s boundary or circumference are equidistant from a single point inside the circle.
If the radius of a circle is denoted with “r” the formula for circumference is 2*PI*r.
Program:
#include<stdio.h>
#define PI 3.14
int main()
{
float radius, area;
printf("Enter the radius of the circle: ");
scanf("%f",&radius);
area = 2 * PI * radius;
printf("Area of the circle having radius %.2f = %.2f",
radius, area );
return 0;
}
Output:
Enter the radius of the circle: 5
Area of the circle having radius 5.00 = 31.40
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Codes :
C Program to Convert Kilograms to Grams
C Program to Convert Inches to Centimetre