#include #include class complex { float real_part; float img_part; public: void set float x, float y) { real_part = x; img_part = y; } float get_real(void) { return real_part; } float get_img(void) { return img_part; } friend complex operator+(complex z1, complex z2); friend complex operator+(float a, complex z); friend complex operator*(float a, complex z); }; complex operator+(complex z1, complex z2) { complex temp; temp.real_part = z1.real_part + z2.real_part; temp.img_part = z1.img_part + z2.img_part; return temp; } complex operator+(float a, complex z) { complex temp; temp.real_part = a + z.real_part; temp.img_part = z.img_part; return temp; } complex operator*(float a, complex z) { complex temp; temp.real_part = a * z.real_part; temp.img_part = a * z.img_part; return temp; } int main() { complex c1, c2, c3, c; c1.set(2,4); c2.set(5,6); c3.set(3,7); c = c1 + c2; cout<<"\n the result = "<