GrabCert
HomeExamsProvidersAbout
Sign InSign Up
Home/Exams/C++ Institute C++ Certified Professional Programmer/Question #14
#14Multiple Choice

What happens when you attempt to compile and run the following code?
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;

int main() {
int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 };
map<int, int> m;
for(int i=0; i < 10; i++) {
m[i]=t[i];
}
pair<const int,int> p(5,5);
map<int, int>::iterator it = find(m.begin(), m.end(), p); if (it != m.end())
{
cout<<it?>first<<endl;
}
else
{
cout<<"Not found!\n";
}
return 0;
}
Program outputs:

Previous
Question 14 of 228
Exam CPP Topic 1 Question 14
Back to all questions
Next
GrabCert

Your trusted source for certification exam preparation. Pass your exams with confidence.

Quick Links

  • Home
  • Exams
  • Providers

Legal

  • About
  • Contact Us
  • Refund Policy
  • Privacy Policy
  • Terms of Service

© 2026 GrabCert. All rights reserved.

Sign InSign Up