b?
Which code, inserted at line 8, generates the output "0102020"?
#include <iostream>
using namespace std;
class Base {
static int age;
public:
Base () {};
~Base () {};
//insert code here
void Print() { cout << age;}
};
int Base::age=0;
int main () {
Base a,*b;
b = new Base();
a.Print();
a.setAge(10);
a.Print();
b?>setAge();
a.Print();
b?>Print();
return 0;
}
A . void setAge(int a) {age = a;}
B . void setAge() {age = 20;}
C . void setAge() {age = 10;}
D . void setAge(int a=20) {age = a;}
Answer: D
Latest CPA-21-02 Dumps Valid Version with 222 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Subscribe
Login
0 Comments
Inline Feedbacks
View all comments