The given program will help you to find out the area of circle. This C# program using the simple formula of math's to calculate the area of circle.
Code:
using System;
namespace MyApp
{
class Program
{
static void Main(string[] args)
{
int iRadius;
double dArea;
Console.WriteLine("Enter the radius:");
iRadius = Convert.ToInt32(Console.ReadLine());
dArea = 3.14 * iRadius * iRadius;
Console.WriteLine("The Area of circle is: " + dArea);
Console.ReadLine();
}
}
}
No comments:
Post a Comment