The source code to demonstrate the use of PI property of Math class (In this program, we are going to calculate the area of circle using the PI property.) is given below. The given program is compiled and executed successfully.
using System;
class Sample
{
//Entry point of Program
static public void Main()
{
double AreaOfCircle = 0.0;
int radius = 12;
AreaOfCircle = (Math.PI * radius * radius);
System.Console.WriteLine("Area of Circle: "+AreaOfCircle);
}
}
Output:
Area of Circle: 452.38934211693
Press any key to continue . . .
Program:
The source code to demonstrate the use of PI property of Math class (In this program, we are going to calculate the area of circle using the PI property.) is given below. The given program is compiled and executed successfully.
Output: