Which code, inserted at line 15, generates the output "5 Bob"?
#include <iostream>
#include <string>
using namespace std;
class B;
class A {
int age;
public:
A () { age=5; };
friend void Print(A &ob, B &so);
};
class B {
string name;
public:
B () { name="Bob"; };
//insert code here
};
void Print(A &ob, B &so) {
cout<<ob.age << " " << so.name;
}
int main () {
A a;
B b;
Print(a,b);
return 0;
}
A . friend void Print(A ob, B so);
B . friend void Print(A &ob, B &so);
C . friend void Print(A *ob, B *so);
D . None of these
Answer: B
Latest CPA-21-02 Dumps Valid Version with 222 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund