Sponsored Ad

Monday, January 10, 2011

Calculate Area of Square using C#

This Simple program will help you to find the area of a given Square . As the mathematics formula says, the area should be Square of a side.

      dArea = dLength * dLength;

Calculate Area of Squire using C#

Source Code:

using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            double dLength;
            double dArea;
            Console.WriteLine("Enter the length of a side of Square :");
            dLength = Convert.ToDouble(Console.ReadLine());
            dArea = dLength * dLength;
            Console.WriteLine("The area of Square is: " + dArea);
            Console.ReadLine();
        }    
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates