Calculate the area and circumference of a circle in C language.

 WAP to calculate the area and circumference of a circle.

In this program we will take radius of circle from user as an input calculate area and circumference of circle      using following formula in c language.

  • Area = 3.14 * radius * radius
  • Circumference = 2 * 3.14 * radius



#include<stdio.h>

#include<conio.h>

void main()

{

    float rad, area,crfm;

    printf("Enter Radius Value of Circle: ");

    scanf("%f", &rad);

    area = 3.14*rad*rad;

    crfm=2*3.14*rad;

    printf("\nArea = %f", area);

    printf("\nCircumference = %f", crfm);

    getch();

}


Output

Enter Radius Value of Circle: 5

Area = 12.560000

Circumference = 31.400000






Post a Comment

0 Comments