Saturday, November 7, 2015

Circle calculator

Putting a value of radius, this program calculates the diameter and the area of the circle.
code:

using System;
public class Sample1 {
  public static void Main(string[] args) {
        while(true){
        Console.Write("The radius of circle?: ");
        double radius = double.Parse(Console.ReadLine());
        double diameter = radius * 2;
        double area = radius * radius * Math.PI;
 Console.Write("Diamiter: {0}\nArea: {1}\n", diameter, area);
        }
  }
}