adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <iterator>
    #include <vector>
    using namespace std;
    int main () 
    {
        vector<int> myvector;
        for (int i = 0; i < 10; i++) 
            myvector.push_back(i);
        typedef vector<int> :: iterator iter_int;
        reverse_iterator<iter_int> rev_iterator;
        rev_iterator = myvector.rend() - 4;
        cout << *rev_iterator << endl;
        return 0;
    }

a.

2

b.

3

c.

4

d.

5

Answer: (b).3

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?