Answer to Question #249285 in C# for dhadha

Question #249285

Write a program to calculate the area of a circle and display the reuslt. Use the formula: a=πr^2 where Pi is approximately equal to 3.1416


1
Expert's answer
2021-10-10T09:09:22-0400
using System;


namespace App
{
    class Program
    {
        static void Main(string[] args)
        {
            const double PI = 3.1416;
            Console.Write("Enter a radius of a circle: ");
            double r = Convert.ToDouble(Console.ReadLine());
            double area = PI * r * r;
            Console.WriteLine("The area of a circle = {0}", area);
            Console.ReadLine();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS