C# Program to Demonstrate the Use of Pi Property of Math Class

You are currently viewing C# Program to Demonstrate the Use of Pi Property of Math Class

C# program to demonstrate the use of PI property of Math class

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);
    }
}
Area of Circle: 452.38934211693
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply