Program to Calculate Area of Circle

Leave a Comment
Write a program to calculate area of a circle.  To calculate the area of a circle use the Mathematical formula define below.

Area of Circle is :   π × r2 

Where r is the radius of the circle and the value of PI is 3.14 (22/7). 

Let's say someone input the value of radius of circle (r) is 3.

Area of circle is : 3.14 * 3 * 3

C Program to Calculate Simple Interest.

Print factors of a number.

Program to Calculate Area of Circle

#include <stdio.h>
int main()
 int radius;

/* Declare PI and area as float datatype. */

 float PI=3.14,area;

/* Take radius of a circle as a input from user. */

 printf("\n Enter radius of a circle: ");

 /* Area of circle */

 area = PI * radius * radius;

 printf("\nArea of circle is : %f ",area);



Enter radius of a circle: 3

Area of circle is : 28.260001
If You Enjoyed This, Take 5 Seconds To Share It


Post a Comment