In this example, you will learn about C++ program to find area of the circle with and without using the function.
Formula to find area of the circle:
Area = π. (Diameter / 2)2 Diameter of a Circle The diameter of a circle is the distance from one edge to the other, passing through the center. It is twice the radius. Use this calculator to easily calculate the area of a circle, given its radius in any metric: mm, cm, meters, km, inches, feet, yards, miles, etc. Area of a circle formula The formula for the area of a circle is π x radius2, but the diameter of the circle is d = 2 x r 2, so another way to write it is π x (diameter / 2)2. Note: The result of the cos-1 function in the formula is in radians. Another method If you know the central angle of the segment (the angle subtended by the segment at the center of the circle) you can use the method Area of a circular segment given the central angle. Use this calculator to easily calculate the area of a circle, given its radius in any metric: mm, cm, meters, km, inches, feet, yards, miles, etc. Area of a circle formula The formula for the area of a circle is π x radius2, but the diameter of the circle is d = 2 x r 2, so another way to write it is π x (diameter / 2)2.
where,
mathematical value of Π is 3.14159.

Let’s calculate the are of the circle using two methods.
Area Of A Circle With Diameter
Example: C++ program to find area of the circle.
Output

Example: C++ program to find area of the circle using function.
Output
Explanation


In the first program, we have simply calculated area of the circle in the main program.
However, we have used areaOfCircle( )
function for calculating area of the circle in the second program.
Area Of A Circle
Calculates the area and circumference of a circle given the radius or diameter. | |||
[1] 2021/01/10 00:03 Male / 50 years old level / An engineer / A little /
[2] 2020/12/17 02:13 Male / 60 years old level or over / Self-employed people / Very /
[3] 2020/12/10 07:02 Male / 60 years old level or over / An engineer / Not at All /
[4] 2020/10/27 07:16 Male / Under 20 years old / Elementary school/ Junior high-school student / Very /
[5] 2020/10/24 23:38 Female / 20 years old level / High-school/ University/ Grad student / Very /
[6] 2020/10/08 18:09 Male / Under 20 years old / Elementary school/ Junior high-school student / Useful /
[7] 2020/09/16 02:24 Female / 60 years old level or over / Self-employed people / Useful /
[8] 2020/08/26 00:40 Male / 60 years old level or over / An office worker / A public employee / Very /
[9] 2020/08/06 23:23 Female / Under 20 years old / Elementary school/ Junior high-school student / - /
[10] 2020/07/19 20:56 Female / 20 years old level / Elementary school/ Junior high-school student / Useful / Thank you for your questionnaire. To improve this 'Area of a circle Calculator', please fill in questionnaire.
|
