Write a program to calculate perimeter and area of rectangle. (hint : area = length * breadth , perimeter=2*(length+breadth))
class Rect
{
public static void main(String a[])
{
int l=4;
int b=6;
System.out.println("Area of rectangle is "+(l*b));
System.out.println("Perimeter of rectangle is "+(2*(l+b)));
}
}
Comments
Post a Comment