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;
    for (int i = 1; i < 6; ++i) 
        myvector.push_back(i);
    reverse(myvector.begin(), myvector.end());
    for (vector<int> :: iterator it = myvector.begin(); it != myvector.end(); ++it)
        cout << ' ' << *it;
    return 0;
}

Answer & Solution
Correct Answer: Option B
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.