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

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

What will happen when you attempt to compile and run the following code?#include #include #include using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector v(t, t+10);set s1(v.begin(),v.end());s1.insert(v.begin(),v.end());bool found = s1.find(7);if (found){cout<<"Element found!\n";}else {cout<<"…

Nội dung câu hỏi

What will happen when you attempt to compile and run the following code?#include #include #include using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector v(t, t+10);set s1(v.begin(),v.end());s1.insert(v.begin(),v.end());bool found = s1.find(7);if (found){cout<<"Element found!\n";}else {cout<<"Element not found!\n";}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 will display "Element found!"
  2. B. program will display "Element not found!\n"
  3. C. code will not compile — đáp án hiện tại
  4. D. changing type of variable found to int will make this code compile

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ề