+ 1

Area of the circle

29th Nov 2016, 3:45 PM
Reggie Otucan
Reggie Otucan - avatar
2 Answers
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Radius{ public class Circle // declaration of class - I want to find area of circle {  static void Main(string[] args) { double r; double CircleArea; double pi = 3.14; Console.WriteLine("Would you like to know the area of a circle?");//intro message Console.WriteLine("Please enter the radius."); //promt end-user for number  Console.ReadLine();//reads input from end-user  r = Convert.ToDouble(Console.ReadLine()); //assings number from end-user to variable r CircleArea = (3.14 * r * r); //this is the equation for the area of a circle Console.WriteLine("The area of the circle is" + CircleArea); } } }
29th Nov 2016, 5:22 PM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar
- 3
PI*r*r that r is radius of circle and PI is 3.14... what exactly your problem?
29th Nov 2016, 4:00 PM
Nima Moradi
Nima Moradi - avatar