#include <iostream>
using namespace std;

class CRectArea {
   public:
      CRectArea(int length, int breadth) {
         m_length = length;
         m_breadth = breadth;
      }
      int area() {
         return m_length * m_breadth;
      }
   private:
      int m_length;
      int m_breadth;
};

int main() {
   int length, breadth;
   cout << "Enter the length of the rectangle: ";
   cin >> length;
   cout << "Enter the breadth of the rectangle: ";
   cin >> breadth;
   CRectArea rect(length, breadth);
   cout << "The area of the rectangle is: " << rect.area() << endl;
   return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: