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();
}
}
}
Helpful, Thank you..
ReplyDeletePost a Comment