C Program To Calculate Area and Circumference of Circle

This C program accepts the radius of Circle from user and calculates the area and circumference of circle.
Area of Circle:
Formula to Find Area of Circle = π * r2

Circumference of Circle:
Formula to Find Circumference of Circle = 2 * π * r

where r is the radius of circle and π is a
mathematical constant that is the ratio of a
circle's circumference to its diameter,
and is approximately equal to 3.14159.

C Program to Calculate Area and Circumference of a Circle

/* C code to calculate the area and circumference of a circle */

#include<stdio.h>
int main()
{
	float area, circumference, radius;
 
	printf("\n \n Enter the Radius of Circle: ");
	scanf("%f",&radius);
 
	area = 3.14 * radius * radius;
	c=2*3.14*r;


	printf("\n Area of Circle is %.2f \n", area);
	printf("\n \n The Circumference of Circle is %.2f \n", circumference);

	return 0;
}

Output:

 Enter the Radius of Circle: 4

 Area of Circle is 50.24

 The Circumference is 25.12

Explanation:

Accept the radius of Circle from user. Calculate the area and circumference using the formulae given above and display the area and circumference. .2f truncates the resultant floating point number to 2 decimal points only.