The formula to calculate the area of a circumference is defined as A = Ï€ . R2. Considering to this problem that Ï€ = 3.14159:
Calculate the area using the formula given in the problem description.

Solution
Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic
using System;

namespace _1002_Area_of_a_circle
{
    class Program
    {
        static void Main(string[] args)
        {
            double R, n = 3.14159, A;
            R = Convert.ToDouble(Console.ReadLine());
            A = n * R * R;
            Console.WriteLine("A=" + A.ToString("f4"));

            Console.ReadKey();
        }
    }
}

1 Comments

Post a Comment

Previous Post Next Post