How to create a program in C# (and Visual Basics) which calculates the area of a rectangle?

To find the area of a rectangle, multiply the length by the width.

The formula is:

A = L x W

where A is the area, L is the length, W is the width, and X means multiply

and the code is:

```using System;

class AreaRectangle
{
static void Main()
{
//Rectangle Area: A (area) = L (length) x W (width)

decimal area = lengthSide * widthSide;
Console.WriteLine("The area of your rectangle is: {0}", area);
}
}``` edited by user golearnweb

Here's another solution - including the calculation of the perimeter of the rectangle:

```using System;

class Rectangles
{
static void Main()
//Area of a rectangle: A = width * height
//Perimeter of a rectangle: P = 2*(width + height)
{

double area = width * height;
double perimeter = 2 * (width + height);

Console.WriteLine("The AREA of your rectangle is: {0}", area);
Console.WriteLine("The PERIMETER of your rectangle is: {0}", perimeter);
}
}```
edited by user golearnweb

and another one:

```using System;

class Rectangles
{
static void Main()
{
//Problem 4. Write an expression that calculates rectangle’s perimeter and area by given width and height.
Console.Write("Enter the rectangle's height:");