Author : Rahul

Write a program to calculate the area of the circle


Program:

using System;

namespace ProgrammingQuestion
{
 class Program
 {
   static void Main(string[] args)
   {
     //Variable Declaration
     string radiusVal;
     double pi = 3.14, area, radius;
     
     //User Input
     Console.Write("Enter Radius of the Circle:");
     radiusVal = Console.ReadLine();
     radius = Convert.ToDouble(radiusVal);
     
     //Area of the Circle Logic
     area = pi * radius * radius;
     
     //Print Result
     Console.WriteLine($"Area of the Circle: {area}");
     Console.Read();
   }
 }
}

Output:

Enter Radius of the Circle:5.5
Area of the Circle: 94.985