C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 37 Topic 4 Discussion

C++ Institute CPA - C++ Certified Associate Programmer CPA-21-02 Question # 37 Topic 4 Discussion

CPA-21-02 Exam Topic 4 Question 37 Discussion:
Question #: 37
Topic #: 4

What is the output of the program?

#include

using namespace std;

class BaseC

{

int i;

public:

BaseC() { i=?1;}

BaseC(int i) { i=i; }

void seti(int a) { i = a; };

void Print() { cout << i; }

};

int main()

{

BaseC *o = new BaseC();

o?>seti(10);

o?>Print();

}


A.

It prints: 10


B.

It prints: ?1


C.

It prints: 0


D.

Compilation error


Get Premium CPA-21-02 Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.