1. Calculate the area and circumference of a circle.
#include<stdio.h>
#define PI 3.14285714
int main()
{
float radius,area,circum;
printf("Enter the Radius of the Circle:");
scanf("%f",&radius);
area=PI*radius*radius;
circum=2*PI*radius;
printf("Area of the Circle is %f",area);
printf("\nCircumference of the Circle is %f:",circum);
return(0);
}
Output
Enter the Radius of the Circle:5
Area of the Circle is 78.571426
Circumference of the Circle is 31.428572: