C# Program to Calculate the Area of a Square

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

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

private static void Main(string[] args)
        {
            Console.Write("Enter Side of Square: ");
            double side = Convert.ToDouble(Console.ReadLine());
            double area = side*side;
            Console.WriteLine("Area of square having side {0} is: {1}", side,area);
            Console.ReadLine();
        }

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

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

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
1 + 2 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2022 CodingFusion
75 Important SQL Server queries you should know