A program to read radius and calculate circumference of a circle
C Programming Language 103
- Write a program to read radius and calculate circumference of a circle
Program
#include <stdio.h>
#define PI 3.14
void main()
{
float circum, radius;
printf("Enter radius: ");
scanf("%f", &radius);
circum = PI * 2 * radius;
printf("Circumference is %f", circum);
printf("\n");
}
Result
Enter radius: 1
Circumference is 6.280000
Enter radius: 3
Circumference is 18.840000
Last Updated on
Comments