Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmasmnth

Which code, inserted at line 8, generates the output "0102020"?

Which code, inserted at line 8, generates the output "0102020"?

#include

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;}

C++ Institute CPA-21-02 Summary

  • Vendor: C++ Institute
  • Product: CPA-21-02
  • Update on: Aug 2, 2025
  • Questions: 257
Price: $52.5  $149.99
Buy Now CPA-21-02 PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method