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: Jul 28, 2025
Add To Cart
Question 1

What happens when you attempt to compile and run the following code? #include  #include #include  #include  using namespace std; class B { int val; public: B(int v):val(v){} int getV() const {return val;} bool operator > (const B & v) const { return val>v.val;} }; ostream & operator <<(ostream & out, const B & v) { out<struct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< d1(t, t+10); sort(d1.begin(), d1.end(), greater()); pair ::iterator, deque::iterator > result = equal_range(d1.begin(), d1.end(),B(20), greater()); for_each(result.first, result.second, Out(cout));cout<


Answer: B
Question 2

What happens when you attempt to compile and run the following code? #include  #include  #include  using namespace std; class B { int val; public: B(int v):val(v){} int getV() const {return val;} bool operator < (const B & v) const { return valstruct Out { ostream & out; Out(ostream & o): out(o){} void operator() (const T & val ) { out< v1(10,0); sort(t1, t1+5); sort(t2, t2+5); set_union(t1,t1+5,t2,t2+5,v1.begin()); for_each(v1.begin(), v1.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; templateclass B { T val; public: B(T v):val(v){} T getV() const {return val;} bool operator < (const B & v) const { return valostream & operator <<(ostream & out, const B & v) { out<struct Out { ostream & out; Out(ostream & o): out(o){}void operator() (const T & val ) { out< &a, const B &b) { return int(a.getV()) > v1; v1.assign(t, t+10); stable_sort(v1.begin(), v1.end(), Less); for_each(v1.begin(), v1.end(), Out >(cout));cout<


Answer: A
Question 4

What happens when you attempt to compile and run the following code? #include  #include  #include  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 m; for(int i=0; i<10; i++) { m.insert(pair(second[i],first[i])); } if (m[11] == "eleven") { cout<<"eleven "; } for(multimap::iterator i=m.begin();i!= m.end(); i++) { cout<second<<" "; }cout<


Answer: A
Question 5

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
Page:    1 / 46      
Total 230 Questions | Updated On: Jul 28, 2025
Add To Cart

© Copyrights DumpsCertify 2025. All Rights Reserved

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