C Program to Calculate Area and Circumference of circle - C Program

C Program to Calculate Area and Circumference of circle

#include<stdio.h>
 
int main() 
{
 
   int rad;
   float PI = 3.14, area, ci;
 
   printf("\nEnter radius of circle: ");
   scanf("%d", &rad);
 
   area = PI * rad * rad;
   printf("\nArea of circle : %f ", area);
 
   ci = 2 * PI * rad;
   printf("\nCircumference : %f ", ci);
 
   return 0;
}

Output - C Program to Calculate Area and Circumference of circle

Enter radius of a circle : 1
Area of circle : 3.14
Circumference  : 6.28
Compile and Run Online