adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <algorithm>
    #include <vector>
    #include <utility>
    using namespace std;
    bool mypredicate (int i, int j)
    {
        return (i == j);
    }
    int main () 
    {
        vector<int> myvector;
        for (int i = 1; i < 6; i++) myvector.push_back (i * 10);
        int myints[] = {10, 20, 30, 40, 1024};
        pair<vector<int> :: iterator, int*> mypair;
        mypair = mismatch (myvector.begin(), myvector.end(), myints);
        cout  << *mypair.first<<'\n';
        cout  << *mypair.second << '\n';
        ++mypair.first; ++mypair.second;
        return 0;
    }

a.

40 1024

b.

50 1024

c.

20 1024

d.

None of the mentioned

Answer: (b).50 1024

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?