Which code, inserted at line 10, generate the output “50”?

Which code, inserted at line 10, generate the output “50”?
#include using namespace std;
class Base { int age; public: Base () { age=5;
};
//insert code here
void Print() { cout << age;} }; void setAge(Base &ob) {ob.age = 0;} int main () { Base a; A. Print(); setAge(a); a.Print(); return 0; } A. Print(); setAge(a); a.Print(); return 0; }
B. friend void setAge(Base ob);
C. friend void setAge(Base *ob);
D. friend void setAge(Base &ob);
E. 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.