This Simple program will help you to find the area of a given Square . As the mathematics formula says, the area should be Square of a side.
dArea = dLength * dLength;
Source Code:
using System;
namespace MyApp
{
class Program
{
static void Main(string[] args)
{
double dLength;
double dArea;
Console.WriteLine("Enter the length of a side of Square :");
dLength = Convert.ToDouble(Console.ReadLine());
dArea = dLength * dLength;
Console.WriteLine("The area of Square is: " + dArea);
Console.ReadLine();
}
}
}
No comments:
Post a Comment