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 #include using namespace std; class Second;
class Base { int age; public: Base () { age=5; }; friend void set(Base &ob, Second &so);
void Print() { cout << age;} }; class Second { string name; public: friend void set(Base &ob, Second &so); void Print() { cout << name;} }; void set(Base &ob, Second &so) { ob.age = 0; so.name = "Bill"; } int main () { Base a; Second b; set(a,b); A. Print();
B. Print(); return 0; }
C. It prints: 0Bill
D. Compilation error
E. It prints: Bill0
F. None of these

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.