Call us at 0700-922-6559 or Click here

WRITE A PROGRAM to find area of a circle using PI as constant

#include < stdio.h >   

#define PI 3.141  

int main()   

{  

    float radius, area;  

    printf(“Enter radius of circle\n”);  

    scanf(“%f”, & radius);  

    area = PI * radius * radius;  

    printf(“Area of circle : %0.4f\n”, area);  

    return 0;  

}

Output:

Enter radius of circle

40

Area of circle : 5025.6001

Leave a Reply

Your email address will not be published. Required fields are marked *