Q697
What will be the output of the following C++ code? #include #include #include using namespace std; int main () list firstlist, secondlist; for (int i = 1; i :: iterator it; it = firstlist.begin(); advance (it, 3); copy (secondlist.begin(), secondlist.end(), inserter(firstlist, it)); for ( it = firstlist.begin(); it != firstlist.end(); ++it ) cout << *it << " "; return 0;
A.
10 20 1 2
AnswerB.
10 20
C.
1 2
D.
1 10
Answer: Option A
Solution
Answer: Option A
No explanation is given for this question Let's Discuss on Board