Solution :-
import java.util.*;
class add
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
System.out.println(“Enter the length of a Rectangle :- “);
int len= in.nextInt();
System.out.println(“Enter the Width of a Rectangle :- “);
int width = in.nextInt();
int peri = 2 * (len + width);
System.out.println(“The area of a rectangle is :- “+peri5);
}
}
Output :-