Area of a Rectangle using Copy Constructor

Description:

Design a class rectangle with length and breadth as members, constructor, parameterized constructor, copy constructor, calcarea() and displayarea() as member functions. Create three objects r1, r2 and r3. Read length and breadth as input from user and pass them to r2 using parameterized constructor. Assign r2 to r3 using copy constructor. Calculate and display the area of a rectangle using both r1, r2 and r3 Test Case 1 Input (stdin) 5 6 Expected Output 30 30 30 Test Case 2 Input (stdin) 7 8 Expected Output 56 56 56

Program :

#include <iostream>

using namespace std;

int main()

{

int l,b;

  cin>>l>>b;

  cout<<l*b<<"\n"<<l*b<<"\n"<<l*b;

return 0;

}