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

What happens when you attempt to compile and run the following code?
#include using namespace std;
class Test { float i,j;
};
class Add { public: int x,y;
Add (int a=3, int b=3) { x=a; y=b; }
int result() { return x+y;}
};
int main () { Test test; Add * padd; padd = &test; cout << padd?>result();
return 0; }
A. It prints: 6
B. It prints: 9
C. Compilation error
D. It prints: 33

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.