Home / MCQ Bank / Computer
Computer Plus Plus Miscellaneous Difficulty: Medium

What will be the output of the following C++ code? #include <iostream> #include <vector> #include <algorithm> using namespace std; void Display(const vector<int>& vi) { for (size_t i = 0; i < vi.size(); ++i) cout << vi[i]; cout<<endl; } int main() { vector<int> vi; vi.push_back(3); vi.push_back(5); sort(vi.begin(), vi.end()); Display(vi); while(next_permutation(vi.begin(), vi.end())) Display(vi); return 0; }

Select the correct option to test your answer:

More Computer Questions

What are the updated values of high and low in the array if the element being searched is lower than the value at calculated index in interpolation search? (pos = current position) . . . . . . . . is used to determine what is plotted for each group. Which Ruby convention is commonly used for naming global variables? What will be the output of the following C++ code? #include <iostream> #include <deque> using namespace std; int main () { unsigned int i; deque<int> mydeque; mydeque.push_back (100); mydeque.push_back (200); mydeque.push_back (300); for(deque<int> :: iterator it = mydeque.begin(); it != mydeque.end(); ++it) { } mydeque.clear(); mydeque.push_back (110); mydeque.push_back (220); for(deque<int> :: iterator it = mydeque.begin(); it != mydeque.end(); ++it) cout << ' ' << *it; cout << '\n'; return 0; } What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int arr[] = {4, 5, 6, 7}; int *p = (arr + 1); cout << *p; return 0; }