a program for generating area of circle
Answers
Answered by
2
hey buddy....
here is ur ans....
The formula to calculate the area is: Area = π × r2 where r is the radius of the circle & π value is 22/7.
Program/Source Code
Here is source code of the C program to calculate the area of a circle. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C program to find the area of a circle, given the radius
*/
#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);
}
Program Explanation
In this C program, library function defined in <math.h> header file is used to compute mathematical functions. We are reading the radius of a circle using ‘radius’ variable. To find the area of a circle, the following formula is used.
Area = PI * pow (radius, 2)....
#hope it helps you...
plzz mark it as brainliest....
here is ur ans....
The formula to calculate the area is: Area = π × r2 where r is the radius of the circle & π value is 22/7.
Program/Source Code
Here is source code of the C program to calculate the area of a circle. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
/*
* C program to find the area of a circle, given the radius
*/
#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);
}
Program Explanation
In this C program, library function defined in <math.h> header file is used to compute mathematical functions. We are reading the radius of a circle using ‘radius’ variable. To find the area of a circle, the following formula is used.
Area = PI * pow (radius, 2)....
#hope it helps you...
plzz mark it as brainliest....
Similar questions