/*Program to find circumference of the circle*/
#include <stdio.h>
#define PI 3.14
int main()
{
float r,circumference;
printf("Enter the radius of the circle:");
scanf("%f",&r);
circumference=2*PI*r;
printf("The circumference of the circle is %.2f",circumference);
return 0;
}
OUTPUT
Enter the radius of the circle: 2.7
The circumference of the circle is 16.96
Description:
Here we ask the user to give the radius of the circle and the value of PI is defined by define function.
No comments:
Post a Comment
If you have any doubt, please ask in the comment section.