This example explain you how to calculate area of a rectangle using java code. For calculating area of rectangle, we need three variables. One for length, one for breadth and one variable calculate the area of rectangle. We have already read and know how to calculate area of rectangle using formula a=lXb. Here is the source code to find the area of rectangle :
class Rectangleexample
{
public static void main(String[] args)
{
int len=5, breadth=7, area=1;
area = len*breadth;
System.out.println("Area if Rectangle :" + area);
}
}
Showing posts with label area of rectangle. Show all posts
Showing posts with label area of rectangle. Show all posts
Monday, June 30, 2008
Subscribe to:
Posts (Atom)