View Single Post
  #1  
Old 17-06-2011, 09:54 PM
thecool's Avatar
thecool thecool is offline
Senior Member


 
Join Date: Apr 2009
Location: Multan
Posts: 1,163
Contact Number: Push me a PM if you really need
Program / Discipline: Alumni
Class Roll Number: ---
thecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond reputethecool has a reputation beyond repute
Smartass Calculate Area Of Rectangle In c#

how Calculate Area Of ectangle In c#
Code:
using System;
using System.Collections.Generic;
using System.Text;
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(); } } }

Reply With Quote