To perform operations on complex number using operator :#include #include #include #include class comp { private: float real,image; public: comp operator +(comp a); comp operator -(comp a); comp operator *(comp a); comp operator /(comp a); void getdata(); void show(); }; void comp :: getdata() { cout<<" Enter real part="; cin>>real; cout<<" Enter imaginary part="; cin>>image; } void comp :: show() { cout.precision(2); if(image<0) cout<Addition"; cout<<" 2>Subtraction"; cout<<" 3>Multiplication"; cout<<" 4>Division"; cout<<" 5>Exit"; d.getdata(); e.getdata(); cout<<" first no=>"; d.show(); cout<<" second no=>"; e.show(); cout<<" enter the choice=>"; cin>>ch; switch(ch) { case 1: f=d-e; cout<<" addition of two no=>"; f.show(); break; case 2: f=d-e; cout<<" subtraction of two no=>"; f.show(); break; case 3: f=d*e; cout<<" multiplication of two no=>"; f.show(); break; case 4: f=d/e; cout<<" division of two no=>"; f.show(); break; case 5: exit(0); break; } cout<<" do you want to continue(y/n)?="; cin>>ans; } while(ans=='y'||ans=='Y'); getch(); }