Write a C program to find the area and circumference of the circle.
#include<stdio.h>
#include<conio.h>
void main()
{
float radius, circumference, area;
clrscr();
printf("Enter the radius of the circle: ");
scanf("%f",&radius);
area=3.142*radius*radius;
circumference=2*3.142*radius;
printf("Area of the circle=%f\nCircumference of the circle=%f\n",area,circumference);
getch();
}
Output:
Enter the radius of the circle: 3
Area of the circle=28.278000
Circumference of the circle=18.851999
No comments: