title: Add complex numbers code
body: <pre><code>class complex1   
  {   
      public:
          int real,img;
          complex1(){}
          complex1(int a)
          {
              real=a;
              img=a;
          }
          complex1(int a,int b)
          {
              real=a;
              img=b;
          }
  
          complex1 sum(int x,complex1 y);
          complex1 sum(complex1,complex1);
          complex1 display(complex1); 
  };
  
  complex1 complex1::sum(int x,complex1 y)
  {
      complex1 num;
      num.real=x+y.real;
      num.img=y.img;
      return num;
  }
  
  complex1 complex1::sum(complex1 a,complex1 b)
  {
      complex1 num;
      num.real=a.real+b.real;
      num.img=a.img+b.img;
      return num;
  
  }
  
  complex1 complex1::display(complex1 c)
  {
      cout&lt;&lt;"The complex number is:\n";
      cout&lt;&lt;c.real&lt;&lt;"+i"&lt;&lt;c.img;
  }
  
  main()
  {
      complex1 p,q,r,s;
      p=complex1(2,4);
      q=complex1 (3,5);
  
  
      cout&lt;&lt;"\n";
      cout&lt;&lt;"p="&lt;&lt;display(p);
      cout&lt;&lt;"q="&lt;&lt;display(q);
  }
  </code></pre>
  
  <p>Using constructors we need to add two complex numbers. I get the error</p>
  
  <blockquote>
    <p>Error: display was not declared in this scope.</p>
  </blockquote>
  
  <p>Any suggestions? where am I wrong?</p>