CPA-21-02 試験問題を無料オンラインアクセス
| 試験コード: | CPA-21-02 |
| 試験名称: | CPA - C++ Certified Associate Programmer |
| 認定資格: | C++ Institute |
| 無料問題数: | 256 |
| 更新日: | 2026-05-28 |
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();
}
Which statement should be added in the following program to make work it correctly?
using namespace std;
int main (int argc, const char * argv[])
{
cout<<"Hello";
}
