Câu hỏi:

28/07/2025 43 Lưu

What is the output of the following code? #include using namespace std; class professor { public: professor() { cout << "professor "; }; }; class researcher { public: researcher() { cout << "researcher "; }; }; class teacher : public professor { public: teacher() { cout << "teacher "; }; }; class myprofessor : public teacher, public virtual researcher { public: myprofessor() { cout << "myprofessor "; }; }; int main() { myprofessor obj; system("pause"); return 0; }

A. professor researcher teacher myprofessor

B. researcher professor teacher myprofessor

C. myprofessor teacher researcher professor

D. myprofessor researcher professor teacher

Quảng cáo

Trả lời:

verified Giải bởi Vietjack

Chọn đáp án B

CÂU HỎI HOT CÙNG CHỦ ĐỀ

Câu 3

A. A const member

B. A reference parameter

C. A static member

D. A function member

Lời giải

Bạn cần đăng ký gói VIP ( giá chỉ từ 199K ) để làm bài, xem đáp án và lời giải chi tiết không giới hạn.

Nâng cấp VIP

Lời giải

Bạn cần đăng ký gói VIP ( giá chỉ từ 199K ) để làm bài, xem đáp án và lời giải chi tiết không giới hạn.

Nâng cấp VIP

Lời giải

Bạn cần đăng ký gói VIP ( giá chỉ từ 199K ) để làm bài, xem đáp án và lời giải chi tiết không giới hạn.

Nâng cấp VIP