CI

C++ Certified Associate Programmer

219 Questions

You can start the exam to practice all questions related to this exam.

Question No. 1

Which code, inserted at line 5, generates the output "ABC"?

#include <iostream>
using namespace std;
class A {
public:
//insert code here
};
class B:public A {
public:
void Print(){ cout<< "B"; }
};
class C:public B {
public:
void Print(){ cout<< "C"; }
};
int main()
{
A ob1;
B ob2;
C ob3;
A *obj;
obj = &ob1;
obj?>Print();
obj = &ob2;
obj?>Print();
obj = &ob3;
obj?>Print();
}
Choose the correct option from the given list.
01 / 219

0 Discussions

Trending Exams