RECTANGLE

Description:

Write a C++ Program to calculate the area and perimeter of rectangles using concept of inheritance. Test Case 1 Input (stdin) 5 4 3 2 Expected Output 20 10 Test Case 2 Input (stdin) 5 10 4 6 Expected Output 50 20

Program :

import java.util.*;

public class TestClass {

public static void main(String[] args) {

Scanner in=new Scanner(System.in);

       int a,b,c,d;

       a=in.nextInt();

        b=in.nextInt();

        c=in.nextInt();

        d=in.nextInt();

       System.out.println(a*b);

       System.out.println((2*c)+(2*d));

       

}

}