using System;
class Rectangle
{
public int height;
public int width;
public void area()
{
Console.WriteLine("The area of the Rectangle is: " + height * width);
}
}
using System;
class Program
{
public static void Main(String[] args)
{
Rectangle rec = new Rectangle();
rec.height = 10;
rec.width = 5;
rec.area();
}
}
Method in class
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment