Search This Blog


Thursday, 11 April 2019

C Program to Find Area and Circumference of Circle

C Program to Find Area and Circumference of Circle in Language C



Welcome back to codejunction.in  , Make sure to check out our other blogs too, have a good day.
In this Program the user need to Enter the Radius of circle and then the Area 
and Circumference of the circle will be calculated.

This program will read the radius of the circle and find out the area and circumference of the circle. Area of ​​the circle is calculated by PI * R2. Circumal circumference is calculated by 2 * PI * R. Here, there is a radius of "R" circle, in this program we have a macro defined as PI with the value of PI and the variable radius keeps the user recorded radius.


FORMULA:-              CIRCUMFERENCE   - 3.14 * radius * radius
                                    AREA                          - 2 * 3.14 * radius

CODE

#include<stdio.h>
int main()
{
int radius,circum,area;
printf("ENTER RADIUS OF CIRCLE");
scanf("%d",&radius);

circum=3.14*radius*radius;
area=2*3.14*radius;

printf("\n CIRCUMFERENCE: %d",circum);
printf("\n AREA: %d",area);



return 0;
}




OUTPUT

No comments:

Post a Comment