C# Program Calculating the Area of a Rectangle

C# Program Calculating the Area of a Rectangle

C# Program Calculating the Area of a Rectangle

Object: Let us consider a Rectangle object. It has attributes such as length and width. Depending upon the design, it may need ways for accepting the values of these attributes, calculating the area, and displaying details. C# Projects.

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lab1b
{
class Rectangle
{
public void mul(int length, int width)
{
Console.WriteLine(“Length = “+(length));
Console.WriteLine(“Width = “+(width));
Console.WriteLine(“Area of Rectangle = ” +(width * length));
}
}
class Program
{
static void Main(string[] args)
{
Rectangle obj= new Rectangle();
obj.mul(5,3);
Console.ReadKey();
}
}
}

Output:

C# Program Calculating the Area of a Rectangle

C++ projects for beginners with source code

M.A Siddiqui

Hi, I am M.A Siddiqui. I'm a Computer Science Student, In this website, I'm teaching you Multiple languages and provides Projects and other Subjects Notes.

You may also like...

8 Responses

  1. July 26, 2020

    […] Another Program: C# Program Calculating the Area of a Rectangle […]

  2. August 14, 2020

    […] Another Program: C# Program Calculating the Area of a Rectangle […]

  3. August 16, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

  4. August 20, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

  5. August 25, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

  6. September 3, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

  7. September 6, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

  8. October 3, 2020

    […] Another C# Program: C# Program Calculating the Area of a Rectangle […]

Leave a Reply

Your email address will not be published. Required fields are marked *