BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/index.php)
-   Visual Programming (http://bzupages.com/forumdisplay.php?f=73)
-   -   Calculate Area Of Rectangle In c# (http://bzupages.com/showthread.php?t=16478)

thecool 17-06-2011 09:54 PM

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(); } } }



All times are GMT +5. The time now is 11:23 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.