using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class circle
{
public double r;
public void getdata()
{
Console.Write("Enter the radius");
r = int.Parse(Console.ReadLine());
}
}
public class area:circle
{
public double ar;
public void area1()
{
ar = 3.14 * r * r;
}
public void showdata()
{
Console.Write("The area of the circle is:" + ar);
}
}
static void Main(string[] args)
{
area a = new area();
a.getdata();
a.area1();
a.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
public class circle
{
public double r;
public void getdata()
{
Console.Write("Enter the radius");
r = int.Parse(Console.ReadLine());
}
}
public class area:circle
{
public double ar;
public void area1()
{
ar = 3.14 * r * r;
}
public void showdata()
{
Console.Write("The area of the circle is:" + ar);
}
}
static void Main(string[] args)
{
area a = new area();
a.getdata();
a.area1();
a.showdata();
Console.ReadKey();
}
}
}
/*Do leave a comment if you find this useful*/
No comments:
Post a Comment