CPA-21-02 Web TestEngine demo

Exit VCEDump CPA-21-02 CPA - C++ Certified Associate Programmer
Question 5 of 39
0% complete
Q5 Single choice

What happens when you attempt to compile and run the following code?

#include <iostream>
class complex{

double re;

double im;

public:

complex() : re(0),im(0) {}

complex(double x) { re=x,im=x;};

complex(double x,double y) { re=x,im=y;}

void print() { cout << re << " " << im;}

};

int main(){

complex c1(1,2);

c1.print();

return 0;

}

Sign in to mark questions

Sign in to save marked questions and return to this demo.

Sign in