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);
B. Print(); b?>setAge(); a.Print(); b?>Print(); return 0; }
C. void setAge(int a) {age = a;}
D. void setAge() {age = 20;}
E. void setAge() {age = 10;}
F. void setAge(int a=20) {age = a;}

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.