Thursday 30 August 2012

Calculate Area Of Rectangle In c# | Area calculation code


how Calculate Area Of ectangle In c#

namespace ClassRectangle
{
class Rectangle
{
int length, breadth;
int area;
public void definerectangle(int length_input, int breadth_input)
{
length = length_input;
breadth = breadth_input;
}
public int calculatearea()
{
area = length * breadth; return (area);
}
}
class Program
{
static void Main(string[] args)
{
int area1; Rectangle rect1 = new Rectangle();
rect1.definerectangle(10, 20);
area1 = rect1.calculatearea();
Console.Write("Area of Rectangle is ");
Console.WriteLine(area1); Console.ReadLine(); } } }
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: