Confidently Practice Online with Free CPP-22-02 Exam Cram

Practice your CPP - C++ Certified Professional Programmer certification test with free CPP-22-02 exam cram and take control of your certification preparation. At FreeExamCram, you can practice online for free using real CPP-22-02 exam dumps, verified questions, and expert-designed free online practice tests. Moreover our C++ Institute CPP-22-02 exam cram backed by our confidence-boosting refund guarantee.

Exam Code: CPP-22-02
Exam Questions: 230
CPP - C++ Certified Professional Programmer
Updated: 21 May, 2026
Viewing Page : 1 - 23
Practicing : 1 - 5 of 230 Questions
Question 1

What happens when you attempt to compile and run the following code?
 #include <deque>
 #include <iostream>
 #include <algorithm>
 #include <set>
 using namespace std;
 template<class T>struct Out {
 ostream & out;
 Out(ostream & o): out(o){}
 void operator() (const T & val ) { out<<val<<" "; }
 };
 bool Compare(char a, char b) { return tolower(a) < tolower(b);}
 int main() {
 char s[]={"qwerty"};
 char t1[]={"ert"};
 char t2[]={"ERT"};
 sort(s, s+6);
 cout<<includes(s,s+6, t1,t1+3, Compare)<<" "<<includes(s,s+6, t2,t2+3, Compare)<<endl;
 return 0;
 }
Program outputs:

Options :
Answer: D

Question 2

What happens when you attempt to compile and run the following code?
 #include <iostream>
 #include <map>
 #include <string>
 using namespace std;
 int main(){
 int second[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 10 };
 string first[] = {"three", "four", "two", "one", "six","five", "seven", "nine","eight"," ten"};
 multimap<int,string> m;
 for(int i=0; i<10; i++) {
 m.insert(pair<int,string>(second[i],first[i]));
 }
 if (m[11] == "eleven") {
 cout<<"eleven ";
 }
 for(multimap<int, string>::iterator i=m.begin();i!= m.end(); i++) {
 cout<<i?>second<<" ";
 }cout<<m.size();
 return 0;
 }

Options :
Answer: A

Question 3

What happens when you attempt to compile and run the following code?
#include <iostream>
 #include <map>
 #include <vector>
 #include <sstream>
 #include <string>
 using namespace std;
 int main(){
 int t[] ={ 3, 4, 2, 1, 0, 1, 2, 3, 4, 0 };
 vector<int> v(t, t+10);
 multimap<int,string> m;
 for(vector<int>::iterator i=v.begin(); i!=v.end(); i++) {
 stringstream s; s<<*i<<*i; m.insert(pair<int,string>(*i,s.str()));
 }
 for(multimap<int, string>::iterator i=m.begin();i!= m.end(); i++) {
 cout<<*i<<" ";
 }
 return 0;
 } 

Options :
Answer: A

Question 4

What will be output of the program when you attempt to compile and run the following
code?
 #include <iostream>
 #include <map>
 #include <vector>
 #include <string>
 using namespace std;
 int main(){
 int second[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };
 string first[] = {"three", "four", "two", "one", "six","five", "seven", "nine","eight","zero"};
 multimap<int,string> m;for(int i=0; i<10; i++) {
 m.insert(pair<int,string>(second[i],first[i]));
 }
 m[0]="ten";
 m.insert(pair<int,string>(1,"eleven"));
 for(multimap<int, string>::iterator i=m.begin();i!= m.end(); i++) {
 cout<<i?>second<<" ";
 }
 return 0;
 }

Options :
Answer: A

Question 5

What happens when you attempt to compile and run the following code?
 #include <list>
 #include <iostream>
 using namespace std;
 template<class T>
 void print(T start, T end) {
 while (start != end) {
 std::cout << *start << " "; start++;
 }
 }
 int main()
 {
 int t1[] ={ 1, 7, 8, 4, 5 };
 list<int> l1(t1, t1 + 5);
 int t2[] ={ 3, 2, 6, 9, 0 };
 list<int> l2(t2, t2 + 5);
 l1.sort();
 list<int>::iterator it = l2.begin();
 it++; it++;
l1.splice(l1.end(),l2, it, l2.end());
 print(l1.begin(), l1.end()); cout<<"Size:"<<l1.size()<<" ";
 print(l2.begin(), l2.end()); cout<<"Size:"<<l2.size()<<endl;
 return 0;
 }

Options :
Answer: A

Viewing Page : 1 - 23
Practicing : 1 - 5 of 230 Questions

© Copyrights FreeExamCram 2026. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (FreeExamCram). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreeExamCram.