CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 36: CPP: C++ Certified Professional Programmer

What happens when you attempt to compile and run the following code?#include #include #include using namespace std;int main (){list l1;deque d1;for(int i=0; i<5; i++){l1.push_back(i);l1.push_front(i);d1.push_back(i);d1.push_front(i);}for(int i=0; i<d1.size(); i++){cout<<d1[i]<<" "<<l1[i]<<" ";}cout<<endl;return 0;}

Nội dung câu hỏi

What happens when you attempt to compile and run the following code?#include #include #include using namespace std;int main (){list l1;deque d1;for(int i=0; i<5; i++){l1.push_back(i);l1.push_front(i);d1.push_back(i);d1.push_front(i);}for(int i=0; i<d1.size(); i++){cout<<d1[i]<<" "<<l1[i]<<" ";}cout<<endl;return 0;}

Các lựa chọn

Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.

  1. A. program displays 4 4 3 3 2 2 1 1 0 0 0 0 1 1 2 2 3 3 4 4
  2. B. runtime exception
  3. C. compilation error due to line 11
  4. D. compilation error due to line 12
  5. E. compilation error due to line 16 — đáp án hiện tại

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề