Vidyalelo
C++ Programming · Q397

C++ miscellaneous

Programming · C++ Programming · question 397

Q397

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(); advance(ptr, 2); cout << *ptr << endl; return 0;

A.
2
B.
3
Answer
C.
4
D.
5

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board