Circumference and Area of Circle in C

C Program to find the Circumference and Area of Circle

Source code :

#include <stdio.h>

int main(){

    int radius;
    
    printf("Enter the radius : ");
    
    fflush(stdout);
    
    scanf("%d",&radius);
    
    printf("\nCircumference of Circle : %2.2f", ( 2 * 3.14 * radius ) );
    
    printf("\nArea of Circle : %2.2f", ( 3.14 * radius * radius ) ) ;
    
    return 0;

}

Output :

Enter the radius : 10
Circumference of Circle : 62.80
Area of Circle : 314.00

Algorithm :

  1. Get the radius from the user
  2. Calculate the Circumference using the formula 2πr
  3. Calculate the Area using the formula πr²

Output :


                

Comments :