The following program will calculate circumference of circle for a given radius. if you have a diameter of circle use:
dCircumference = 3.14 * diameter ;
This is simple C# program. Please let us know if you face any problem while implementing.
Source Code of Circle Perimeter:
using System;
namespace MyApp
{
class Program
{
static void Main(string[] args)
{
int iRadius;
double dCircumference;
Console.WriteLine("Enter the radius of given circle:");
iRadius = Convert.ToInt32(Console.ReadLine());
dCircumference = 2 * 3.14 * iRadius;
Console.WriteLine("The circumference of a circle is: " + dCircumference);
Console.ReadLine();
}
}
}
No comments:
Post a Comment