C# Program to Calculate the Area of a Rectangle

In this C# program, we will take input (Length and Width) from the user and calculate the area of a Rectangle. Formula to calculate area of Rectangle is A= Length*Width.

C# Program to Calculate the Area of a Rectangle Code:

  private static void Main(string[] args)
        {
            double Length, Width;
            Console.Write("Enter Length of Rectangle: ");
            Length = Convert.ToDouble(Console.ReadLine());
            Console.Write("Enter Width of Rectangle: ");
            Width = Convert.ToDouble(Console.ReadLine());
            double area = Length * Width;
            Console.WriteLine("Area of Rectangle is : {0}", area);
            Console.ReadLine();
        }	

C# Program to Calculate the Area of a Rectangle Output:

C#-Program-to-Calculate-the-Area-of-a-Rectangle

 
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
6 + 1 =
 

About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice