Pages

Using C# Console Program Calcualate & Print the area of Square.


CODE:


using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;

namespaceAreaofSquare
{
classProgram
    {
staticvoid Main(string[] args)
        {
int l, b;
double A;
Console.WriteLine("Please Enter Length");
            l= Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Please Enter Breath");
            b = Convert.ToInt32(Console.ReadLine());
            A = l*b;
Console.WriteLine(" with Length {0} and breath {1} the area of Square is {2}", l, b, A);


        }
    }

}

OUTPUT:


No comments:

Post a Comment