Pages

By using C# Print the area of Circle on console .


CODE:


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

namespaceAreaofCircle
{
classProgram
    {
staticvoid Main(string[] args)
        {

int r;
constdouble π = 3.142;
double A;
Console.WriteLine("Please Enter radius:");
            r = Convert.ToInt32(Console.ReadLine());
            A = π * r * r;
Console.WriteLine(" with radius {0} the area of circle is {1}", r, A);



        }
    }

}

OUTPUT:


No comments:

Post a Comment