Guys where is the problem?help plz
Here's the code #include<iostream> using namespace std; class complex { public: complex(); complex(double, double); complex add(complex); complex sub(complex); void print(); private: double realpart; double imaginarypart; }; int main() { complex m(1,2),c(3.2,5); complex a=m.add(c); complex b=m.sub(c); a.print(); b.print(); return 0; } complex::complex(double r,double m) { realpart=r; imaginarypart=m; } complex::complex() { realpart=0; imaginarypart=0; } complex complex::add(complex x) { complex z; z.realpart=realpart+x.realpart; z.imaginarypart=imaginarypart+x.imaginarypart; return z; } complex complex::sub(complex y) { complex n; n.realpart=realpart-y.realpart; n.imaginarypart=imaginarypart-y.imaginarypart; return n; } void complex::print() { cout<<realpart<<"+"<<imaginarypart"i"<<endl; cout<<realpart<<"-"<<imaginarypart<<"i"<<endl; }