What happens when you attempt to compile and run the following code?

What happens when you attempt to compile and run the following code?
#include using namespace std;
class Base { static int age; public: Base () {}; ~Base () {}; void setAge(int a=20) {age = a;}
void Print() { cout << age;} }; int Base::age=0; int main () { Base a; A. setAge(10);
B. Print();
C. setAge();
D. Print(); return 0; }
E. It prints: 10
F. It prints: 20
G. It prints: 1020
H. It prints: 2010

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.