#include using namespace std; class Complex { private: float real; int imag; public: Complex() : real(0), imag(0){ } void input() { cin >> real; cin >> imag; } Complex operator - (Complex c2) /* Operator Function */ { Complex temp; temp.real = real - c2.real; temp.imag = imag - c2.imag; return temp; } Complex operator + (Complex c2) /* Operator Function */ { Complex temp; temp.real = real + c2.real; temp.imag = imag + c2.imag; return temp; } void output() { cout << "Output number: " << real <<" "<< imag << endl; } }; int main() { Complex c1, c2, result; cout << "Enter first numbers:\n"; c1.input(); cout << "Enter second numbers:\n"; c2.input(); result = c1 - c2; /* c2 is furnised as an argument to the operator function. */ result.output(); //sum result = c1 +c2; /* c2 is furnised as an argument to the operator function. */ result.output(); return 0; }