Q107
What will be the output of the following C++ code? #include #include #include using namespace std; int main() vector ar = 1, 2, 3, 4, 5 ; vector ::iterator ptr = ar.begin(); ptr = advance(ptr, 2); cout << *ptr << endl; return 0;
A.
3
B.
4
C.
Error
AnswerD.
Segmentation fault
Answer: Option C
Solution
Answer: Option C
No explanation is given for this question Let's Discuss on Board