The length of a rectangle is 100 and breadth is twice its length
Find area and perimeter in two different lines using JavaScript
Answers
Answered by
1
import java.io.*;
class rectangle
{
public static void main () throws IOException
{
int length=100;
int breadth=200;
//2 * 100=200
int perimeter;
int area;
perimeter=2*(length+breadth);
area=length*breadth;
System.out.println("area::"+area);
System.out.println("perimeter::"+perimeter);
}
}
class rectangle
{
public static void main () throws IOException
{
int length=100;
int breadth=200;
//2 * 100=200
int perimeter;
int area;
perimeter=2*(length+breadth);
area=length*breadth;
System.out.println("area::"+area);
System.out.println("perimeter::"+perimeter);
}
}
Similar questions