+ 1
Area of the circle
2 Respostas
0
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);
}
}
}
- 3
PI*r*r
that r is radius of circle and PI is 3.14...
what exactly your problem?