Which code, inserted at line 10, generate the output "50"?
#include <iostream>
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;
- Print();
setAge(a); - Print();
return 0;
} - friend void setAge(Base ob);
- friend void setAge(Base *ob);
- friend void setAge(Base &ob);
- None of these
Reveal Solution Next Question