Thursday, 16 November 2017

C Program to Calculate the Area of a Circle


Code:

#include   stdio.h
#include   math.h
#define PI 3.142

void main()
{
    float radius, area;

    printf("Enter the radius of a circle \n");
    scanf("%f", &radius);
    area = PI * pow(radius, 2);
    printf("Area of a circle = %5.2f\n", area);
}

Output:

Enter the radius of a circle
30
Area of a circle = 2827.80


More C Programs:















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...