Live quiz

cpp - Part 93

Question 1 of 25 Hints left: 3
Q1

What will be the output of the following C++ code? #include <iostream> #include <vector> using namespace std; int main() { vector<int> v; for (int i = 1; i <= 5; i++) v.push_back(i); vector<int> :: iterator i; i = v.begin(); *i = 3; for (i = v.begin(); i != v.end(); ++i) cout << *i << " "; cout<<endl; return 0; }

  • A
  • B
  • C
  • D