Question 67 : Write a program in Java to find the area and perimeter of a rectangle. Length and breadth to be taken as input from the user.
Java Program :
public class rectangle
{
public static void main(int l,int b)
{
int a=0,p=0;
a=l*b;
p=2*(l+b);
System.out.println("Area of the rectangle = "+a+" units");
System.out.println("Perimeter of the rectangle = "+p+" units");
}
}
Java Program :
public class rectangle
{
public static void main(int l,int b)
{
int a=0,p=0;
a=l*b;
p=2*(l+b);
System.out.println("Area of the rectangle = "+a+" units");
System.out.println("Perimeter of the rectangle = "+p+" units");
}
}
It's good to be here and this program about How to Find Area of a Rectangle is totally helpful for me .Thanks for helping me for this .
ReplyDelete