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;
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