Sponsored Ad

Monday, January 10, 2011

How to Calculate Area of Circle using C#

The given program will help you to find out the area of circle. This C# program using the simple formula of math's to calculate the area of circle.

How to Calculate Area of Circle using C#

Code:

using System;

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

No comments:

Post a Comment

Post a Comment

Sponsored Ad

Development Updates