// CS304P Lab 6 Problem KST Learning #include #include using namespace std; class Complex { private: int real, imag; public: Complex() { real = 0; imag = 0; } friend istream & operator >>(istream &in, Complex &obj) { cout << "Please Enter Real Part of Complex Number : "; in >> obj.real; cout << "\n\nPlease Enter Imaginary Part of Complex Number : "; in >> obj.imag; return in; } friend ostream & operator <<(ostream &out, Complex &obj) { out << obj.real << "+" << obj.imag << "i"; return out; } }; main() { Complex com1; cin >> com1; cout << "\n\nThe Complex Object is: "; cout << com1; getch(); return 0; }