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

What will be the output of the following C++ code?
#include <iostream>
#include <vector>
using namespace std;
int main()
{
    vector<int> v;
    v.assign( 10, 42 );
    for (int i = 0; i < v.size(); i++) 
    {
        cout << v[i] << " ";
    }
}

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.