ExamVeda
Login
Home
Standard Template Library (STL) in C plus plus
?

What will be the output of the following C++ code?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main () 
{
    vector<int> myvector (4);
    fill (myvector.begin(), myvector.begin() + 2, 3);
    fill (myvector.begin() + 1, myvector.end() - 1, 4);
    for (vector<int> :: iterator it = myvector.begin(); it != myvector.end(); ++it)
        cout << ' ' << *it;
    return 0;
}

Answer & Solution
Correct Answer: Option D
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.