![]() |
VOOZH | about |
C# is a general-purpose, modern and object-oriented programming language pronounced as โC Sharpโ. In this article, we will see how to calculate the area of a circle in C#.
The area of a circle can be evaluated using the formula:
Area of circle = pi * r * r //where r is the radius of circle
Example 1:
Output:
The formula used to calculate the circle area: ฯ * r * r. Where, r is the radius and ฯ is the mathematical constant Pi. We will take the value of radius from the user as input. For ฯ, we can either define a variable and assign it up to a specific decimal place or we can use Math.PI constant that is available in C#.