Math, asked by madhurjyalaskar7744, 1 year ago

Amit has to find the area and perimeter of a rectangle whose length is 10m and width is 5m.Write a program to do calculation

Answers

Answered by adityasingh19275
0
import java.util.*;
class Rectangle
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int len, wid, perimeter, area;
len=sc.nextInt();
System.out.println("Enter the length of Rectangle="+len);
wid=sc.nextInt();
System.out.println("Enter the width of Rectangle="+wid);
perimeter=2(len+wid);
System.out.println("Perimeter of rectangle is="+perimeter);
area=len*wid;
System.out.println("Area of Rectangle is="+area);
}
}

Hope it helps you....
Similar questions