ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#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;
}

Answer & Solution
Correct Answer: Option B
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.