CPA-21-02 practice question 16 of 35

What happens when you attempt to compile and run the following code? #include #include using namespace std; class complex{ double re, im; public…

Choose your answer, then check it against the explanation.

What happens when you attempt to compile and run the following code? #include #include using namespace std; class complex{ double re, im; public: complex() : re(1),im(0.4) {} complex operator?(complex &t); void Print() { cout << re << " " <re ? t.re; temp.im = this?>im ? t.im; return temp; } int main(){ complex c1,c2,c3; c3 = c1 ? c2; c3.Print(); }
Answer options
Question 16 of 35

Keep practicing

Take the free CPA-21-02 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other CPA-21-02 practice questions

Scroll to Top