title: Having problems with Classes. Any Random result is coming when I am multiplying two numbers.
body: <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std;
  
  class area
  {
  public:
      int l,b;
      int enter()
      {
      cout&lt;&lt;"Enter Length: ";
      cin&gt;&gt;l;
      cout&lt;&lt;"Enter Breadth: ";
      cin&gt;&gt;b;
      }
  };
  
  class rectangle : public area
  
  {
  public:
      int arr()
      {
          cout&lt;&lt;"Area of Rectangle is: "&lt;&lt;l*b;
      }
  
  };
  
  
      int main ()
      {
          area obj;
          rectangle ob;
          obj.enter();
          ob.arr();
      }
  </code></pre>
  
  <p>I am able to enter the values but the result is shown as "344765440". Tell me if there is anything wrong with my code. And I also cannot use inheritance properly. I cannot use the object of "area" class.</p>