Computer Science, asked by AK5HAT, 1 year ago

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 Rhibhu
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);   
}
}
Similar questions