#include <iostream.h>
class Complex
{
private:
int real, image;
public:
Complex (int a=0,int b=0)
{ real =a; image =b; }
void disp()
{ cout<< real <<"+"<< image << "i" <<endl; }
Complex operator +( Complex d )
{ return Complex( real + d.real , image + d.image ); }
Complex operator *( Complex t)
{ return Complex (real* t.real -image* t.image , image* t.real+ real* t.image ); }
};
main()
{
Complex c1(3,4),c2(5,6), c3 ,c4 ;
c3=c1+c2;
c4=c1*c2;
c3.disp();
c4.disp();
}

#include <iostream.h>
class Complex
{
private:
int real, image;
public:
Complex (int a=0,int b=0)
{ real =a; image =b; }
void disp()
{ cout<< real <<"+"<< image << "i" <<endl; }
friend Complex operator +( Complex &d1 , Complex &d2 )
{ return Complex( d1.real + d2.real , d1.image + d2.image ); }
Complex operator *( Complex t)
{ return Complex (real* t.real -image* t.image , image* t.real+ real* t.image ); }
};
main()
{
Complex c1(3,4),c2(5,6), c3 ,c4 ;
c3=c1+c2;
c4=c1*c2;
c3.disp();
c4.disp();
}
#include <iostream.h>
class Complex
{
private:
int real, image;
public:
Complex (int a=0,int b=0)
{ real =a; image =b; }
void disp()
{ cout<< real <<"+"<< image << "i" <<endl; }
friend Complex operator +( Complex &d1 , Complex &d2 )
{ return Complex( d1.real + d2.real , d1.image + d2.image ); }
friend Complex operator *(Complex &t1 , Complex &t2)
{ return Complex (t1.real* t2.real -t1.image* t2.image , t1.image* t2.real+ t1.real* t2.image ); }
};
main()
{
Complex c1(3,4),c2(5,6), c3 ,c4 ;
c3=c1+c2;
c4=c1*c2;
c3.disp();
c4.disp();
}
class Complex
{
private:
int real, image;
public:
Complex (int a=0,int b=0)
{ real =a; image =b; }
void disp()
{ cout<< real <<"+"<< image << "i" <<endl; }
friend Complex operator +( Complex &d1 , Complex &d2 )
{ return Complex( d1.real + d2.real , d1.image + d2.image ); }
friend Complex operator *(Complex &t1 , Complex &t2)
{ return Complex (t1.real* t2.real -t1.image* t2.image , t1.image* t2.real+ t1.real* t2.image ); }
};
main()
{
Complex c1(3,4),c2(5,6), c3 ,c4 ;
c3=c1+c2;
c4=c1*c2;
c3.disp();
c4.disp();
}
