Advertisement

Latest Post

Sunday, 1 January 2017

Program to calculate the area and circumference of a circle

Write a program in C# to calculate the area and circumference of a circle.

Following is the simple C# code :

class Lab
    {
        static void Main(string[] args)
        {
           
            Console.Write("Enter Radius of circle : ");
            
            double radius = double.Parse(Console.ReadLine());

            double perimeter = ((2 * Math.PI) * radius);

            Console.WriteLine("Perimeter Of Circle = {0:F2}", perimeter);
           
            Console.ReadLine();
        }
    }

Output:-


Government Jobs