C++ Institute C++ Certified Professional Programmer CPP Question # 23 Topic 3 Discussion

C++ Institute C++ Certified Professional Programmer CPP Question # 23 Topic 3 Discussion

CPP Exam Topic 3 Question 23 Discussion:
Question #: 23
Topic #: 3

What happens when you attempt to compile and run the following code?

#include

#include

#include

using namespace std;

int main ()

{

int t[] = {1, 2 ,3 ,4 ,5};

vectorv1(t, t+5);

listl1;

l1.assign(v1.end(), v1.begin());

for(int i=0; i

{

cout<

}

cout<

return 0;

}


A.

program displays 5 4 3 2 1


B.

program displays 1 2 3 4 5


C.

compilation error


D.

segmentation fault runtime exception


Get Premium CPP Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.