C# Program Calculating The Area and The Perimeter of Rectangle - C# Program
C# Program Calculating the area and the perimeter of Rectangle
using System;
namespace Area_Perimeter
{
class Program
{
static void Main(string[] args)
{
int l, b;
Console.Write("Enter the length of Rectangle: ");
l = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter the breadth of Rectangle: ");
b = Convert.ToInt32(Console.ReadLine());
int area=l*b;
int peri=2*(l+b);
Console.WriteLine("Area of Rectangle is = {0} and Perimeter is ={1}",area , peri);
Console.ReadKey();
}
}
}
Output - C# Program Calculating the area and the perimeter of Rectangle
Enter the length of Rectangle: 5
Enter the breadth of Rectangle: 4
Area of Rectangle is = 20 and Perimeter is = 18
C# Program Calculating the area and the perimeter of Rectangle