Free C++ Institute CPP-22-02 Exam Questions

Become C++ Institute Certified with updated CPP-22-02 exam questions and correct answers

Page:    1 / 46      
Total 230 Questions | Updated On: Jun 17, 2026
Add To Cart
Question 1

What happens when you attempt to compile and run the following code? #include  using namespace std; template void f(A a) { cout<<1<(a); return 0; }


Answer: A
Question 2

What happens when you attempt to compile and run the following code? #include  #include  #include  using namespace std; templatestruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< d1(t, t+10); sort(d1.begin(), d1.end()); deque::iterator it = upper_bound(d1.begin(), d1.end(), 4); for_each(it, d1.end(), Out(cout));cout<


Answer: A
Question 3

What happens when you attempt to compile and run the following code? #include  #include  #include  using namespace std; int main () { int t[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; vector v1(t, t + 10); deque d1(v1.begin(), v1.end());deque d2; d2 = d1; d2.insert(d1.rbegin(), 10); for(int i = 0; i


Answer: D
Question 4

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 1 2 3 end? #include  #include  #include  #include  using namespace std; templatestruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) {out< l; for( ; !cin.bad() ; ) { int i; cin>>i; l.push_back(i); } for_each(l.begin(), l.end(), Out(cout)); return 0;}Program will output:


Answer: A
Question 5

What happens when you attempt to compile and run the following code? #include  #include  #include  using namespace std; class A { int apublic: A(int a) : a(a) {} int getA() const { return a; } void setA(int a) { this?>a = a; } bool operator==(A & b) { return a == b.a; } }; struct Compare{ bool operator()(const A & a, const A & b) {return a.getA()==b.getA();}; }; int main () { int t[] = {1,2,3,4,5,1,2,3,4,5}; vector v (t,t+10); vector::iterator it; A m1[] = {A(1), A(2), A(3)}; it = search (v.begin(), v.end(), m1, m1+3, Compare()); cout << "First found at position: " << it?v.begin() << endl; return 0; }Program outputs:


Answer: B

© Copyrights DumpsCertify 2026. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the DumpsCertify.