The source code to calculate the size of the area in square-feet in C# is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
// Program to calculate the size of the area in
// square-feet based on specified height and width in C#.
using System;
class AreaDemo
{
static int calculateArea(int lengthInFeets, int widthInFeets)
{
return (lengthInFeets * widthInFeets);
}
public static void Main()
{
int lengthInFeets = 0;
int widthInFeets = 0;
int plotArea = 0;
Console.Write("Enter length of the plot in feets: ");
lengthInFeets = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter width of room in feet:");
widthInFeets = Convert.ToInt32(Console.ReadLine());
plotArea = calculateArea(lengthInFeets, widthInFeets);
Console.WriteLine("Plot area is "+plotArea+" square feet");
}
}
Output:
Enter length of the plot in feets: 20
Enter width of room in feet:36
Plot area is 720 square feet
Press any key to continue . . .
Program:
The source code to calculate the size of the area in square-feet in C# is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output: