Sponsored Ad

Monday, January 10, 2011

How to Calculate Circumference of Circle in C#

The following program will calculate circumference of circle for a given radius. if you have a diameter of circle use:

dCircumference = 3.14 * diameter ;

This is simple C# program. Please let us know if you face any problem while implementing.

How to Calculate Circumference of Circle in C#

Source Code of Circle Perimeter:

using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            int iRadius;
            double dCircumference;
            Console.WriteLine("Enter the radius of given circle:");
            iRadius = Convert.ToInt32(Console.ReadLine());
            dCircumference = 2 * 3.14 * iRadius;
            Console.WriteLine("The circumference of a circle is: " + dCircumference);
            Console.ReadLine();
        }    
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates