Question
#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;
}
a.
1 2 3 4 5
b.
5 4 3 2 1
c.
0 1 2 3 4
d.
None of the mentioned
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. What is the type of the first item in the heap?
View solution
Q. Pick out the correct library in the following choices.
View solution
Q. What kind of iteration does forward_list provide in C++?
View solution
Q. What does the size of the vector refers to in c++?
View solution
Q. Subsequent elements are moved in terms of _____ when an element in inserted in vector?
View solution
Q. What is the use of adapter in STL in c++?
View solution
Q. Which is used to iterate over container?
View solution
Q. What does the function objects implement?
View solution
Q. What are the two advantage of function objects than the function call?
View solution
Q. Which header is need to be used with function objects?
View solution
Q. Which are instances of a class with member function operator() when it is
View solution
Q. How many parameters does a operator() in a function object shoud take?
View solution
Q. How does a sequence of objects are accessed in c++?
View solution
Q. How many parameters are present in mismatch method in non-sequence modifying algorithm?
View solution
Q. What will happen in ‘all_of’ method if the range is empty?
View solution
Q. To what kind of elements does non-modifying sequence algorithm can be applied?
View solution
Q. Pick out the incorrect method in non-modifying sequence algorithm?
View solution
Q. What is the use of middle parameter in rotate method?
View solution
Q. What kind of object is modifying sequence algorithm?
View solution
Q. How the sequence of objects can be accessed?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!