I just started learning c# and what classes and objects are. In the code below I want to able to just type c.circle();
and print every information about this circle like radius, area etc., but when I run it, it doesn't give me any output on the console screen.
class Program
{
static void Main(string[] args)
{
Circle c = new Circle();
c.circle();
}
}
class Circle
{
private double radius = 1.0;
public void circle()
{
getradius();
getarea();
}
public double getradius()
{
return radius;
}
public double getarea()
{
double area = 3.141 * radius * radius;
return area;
}
}