Write a java program to find the area of the rectangle.

Program Code in JAVA:
class AreaRect
{
public static void main(String args[])
{
int len,bre,area;
len= Integer.parseInt(args[0]);
bre=Integer.parseInt(args[1]);
area=len*bre;
system.out.println(“length of rectangle=”+len);
system.out.println(“breadth of rectangle=”+bre);
system.out.println(“area of rectangle=”+area);
}
}

Program Output:
c:\java>javac AreaRect.java
c:\java>java AreaRect
12 6
length of rectangle = 12
breadth of rectangle = 6
area of rectangle= 72
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: