C program for area
of circle
Hello friends, in this blog we see the c program for
finding the area of the circle. To find the area of the circle we must know the formula
for calculating the area of circle i.e. area = 3.14 * radius * radius.
In this formula, the value of is in float i.e. 3.14, so we are using float
datatype and for store fractional value we use %f. By using the following program
we find the area of the circle.
C language code for Area of Circle:
#include<stdio.h>
#include<conio.h>
void main()
{
float radius,
area;/* to accept floating number*/
printf("\nEnter the radius of Circle : ");
//take input from
the user
scanf("%f", &radius);
/* to store the floating number,
&radius
is used to store the number in radius variable*/
area = 3.14 *
radius * radius;
// formula and answer store in area variable
printf("\nArea of Circle : %f sq.unit", area); // display answer
getch();
}
_____________________________________________________________
Output:
Enter the radius of Circle:3
Area of Circle:28.26
Enter the radius of Circle:9.54
Area of circle in C language
Reviewed by Amit Waghmare
on
August 14, 2019
Rating:
No comments: