Sponsored Ad

Monday, January 10, 2011

Find the Rectangle Area in C#

This C# code will help you to find the rectangle are using the C#. You need to just multiply the height and width of rectangle.

            dArea = dHeight * dWidth;

Find the Rectangle Area in C#

Source Code of rectangle Area calculation :

using System;

namespace MyApp
{
    class Program
    {
        static void Main(string[] args)
        {
            double dWidth, dHeight;
            double dArea;
            Console.WriteLine("Enter the both side of rectangle (Height and Width):");
            dHeight = Convert.ToDouble(Console.ReadLine());
            dWidth = Convert.ToDouble(Console.ReadLine());
            dArea = dHeight * dWidth;
            Console.WriteLine("The area of rectangle is: " + dArea);
            Console.ReadLine();
        }    
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates