{"id":117308,"date":"2026-01-07T03:45:04","date_gmt":"2026-01-07T03:45:04","guid":{"rendered":"https:\/\/www.dumpsbase.com\/freedumps\/?p=117308"},"modified":"2026-01-13T08:10:15","modified_gmt":"2026-01-13T08:10:15","slug":"pass-cpp-22-02-exam-in-2026-comprehensive-c-certified-professional-programmer-cpp-22-02-dumps-v8-02-free-dumps-part-1-q1-q40","status":"publish","type":"post","link":"https:\/\/www.dumpsbase.com\/freedumps\/pass-cpp-22-02-exam-in-2026-comprehensive-c-certified-professional-programmer-cpp-22-02-dumps-v8-02-free-dumps-part-1-q1-q40.html","title":{"rendered":"Pass CPP-22-02 Exam in 2026: Comprehensive C++ Certified Professional Programmer CPP-22-02 Dumps (V8.02) + Free Dumps (Part 1, Q1-Q40)"},"content":{"rendered":"<p>Earning the CPP certification demonstrates your proficiency in STL containers, algorithms, iterators, functional programming tools, smart pointers, templates, advanced I\/O manipulation, and modern C++ language features. DumpsBase&#8217;s comprehensive CPP-22-02 dumps (V8.02) make passing the C++ Certified Professional Programmer exam easier. Our CPP-22-02 dumps (V8.02) include 228 practice questions and answers that cover all essential exam topics, ensuring you&#8217;re fully prepared to demonstrate your skills. Expert-designed Q&amp;As align perfectly with the certification requirements and exam objectives. DumpsBase provides everything you need to pass your CPP-22-02 exam confidently on your first attempt. We&#8217;re sharing free dumps so you can check the quality\u2014today we&#8217;re releasing the first part.<\/p>\n<h2>Below are our <span style=\"background-color: #ffcc99;\"><em>CPP-22-02 free dumps (Part 1, Q1-Q40) of V8.02<\/em><\/span> for checking:<\/h2>\n<script>\n\t  window.fbAsyncInit = function() {\n\t    FB.init({\n\t      appId            : '622169541470367',\n\t      autoLogAppEvents : true,\n\t      xfbml            : true,\n\t      version          : 'v3.1'\n\t    });\n\t  };\n\t\n\t  (function(d, s, id){\n\t     var js, fjs = d.getElementsByTagName(s)[0];\n\t     if (d.getElementById(id)) {return;}\n\t     js = d.createElement(s); js.id = id;\n\t     js.src = \"https:\/\/connect.facebook.net\/en_US\/sdk.js\";\n\t     fjs.parentNode.insertBefore(js, fjs);\n\t   }(document, 'script', 'facebook-jssdk'));\n\t<\/script><script type=\"text\/javascript\" >\ndocument.addEventListener(\"DOMContentLoaded\", function(event) { \nif(!window.jQuery) alert(\"The important jQuery library is not properly loaded in your site. Your WordPress theme is probably missing the essential wp_head() call. You can switch to another theme and you will see that the plugin works fine and this notice disappears. If you are still not sure what to do you can contact us for help.\");\n});\n<\/script>  \n  \n<div  id=\"watupro_quiz\" class=\"quiz-area single-page-quiz\">\n<p id=\"submittingExam11404\" style=\"display:none;text-align:center;\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dumpsbase.com\/freedumps\/wp-content\/plugins\/watupro\/img\/loading.gif\" width=\"16\" height=\"16\"><\/p>\n\n<div class=\"watupro-exam-description\" id=\"description-quiz-11404\"><\/div>\n\n<form action=\"\" method=\"post\" class=\"quiz-form\" id=\"quiz-11404\"  enctype=\"multipart\/form-data\" >\n<div class='watu-question ' id='question-1' style=';'><div id='questionWrap-1'  class='   watupro-question-id-448198'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>1. <\/span>Which changes, introduced independently, will allow the code to compile and display \u201cone\u201d \u201ceight\u201d <br \/>\r<br>\u201cnine\u201d \u201cten\u201d? Choose all that apply <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;map&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class A { <br \/>\r<br>int a; <br \/>\r<br>public: <br \/>\r<br>A(int a):a(a){} <br \/>\r<br>int getA() const { return a;} <br \/>\r<br>\/* Insert Code Here 1 *\/ <br \/>\r<br>}; <br \/>\r<br>\/* Insert Code Here 2 *\/ <br \/>\r<br>int main(){ <br \/>\r<br>int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 10 }; <br \/>\r<br>string s[] = {&quot;three&quot;, &quot;four&quot;, &quot;two&quot;, &quot;one&quot;, &quot;six&quot;,&quot;five&quot;, &quot;seven&quot;, &quot;nine&quot;,&quot;eight&quot;,&quot;ten&quot;}; <br \/>\r<br>map&lt;A, string&gt; m;\/* Replace Code Here 3 *\/ <br \/>\r<br>for(int i=0; i&lt;10; i++) { <br \/>\r<br>m.insert(pair&lt;A,string&gt;(A(t[i]),s[i])); <br \/>\r<br>} <br \/>\r<br>m.erase(m.lower_bound(2),m.upper_bound(7)); <br \/>\r<br>map&lt;A, string&gt;::iterator i=m.begin(); \/* Replace Code Here 4 *\/ <br \/>\r<br>for( ;i!= m.end(); i++) { <br \/>\r<br>cout&lt;&lt;i?&gt;second&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_1' value='448198' \/><input type='hidden' id='answerType448198' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448198[]' id='answer-id-1734066' class='answer   answerof-448198 ' value='1734066'   \/><label for='answer-id-1734066' id='answer-label-1734066' class=' answer'><span>operator int() const { return a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448198[]' id='answer-id-1734067' class='answer   answerof-448198 ' value='1734067'   \/><label for='answer-id-1734067' id='answer-label-1734067' class=' answer'><span>bool operator &lt; (const A &amp; b) const { return a&lt;b.a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448198[]' id='answer-id-1734068' class='answer   answerof-448198 ' value='1734068'   \/><label for='answer-id-1734068' id='answer-label-1734068' class=' answer'><span>bool operator &lt; (const A &amp; b) const { return b.a&lt;a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448198[]' id='answer-id-1734069' class='answer   answerof-448198 ' value='1734069'   \/><label for='answer-id-1734069' id='answer-label-1734069' class=' answer'><span>struct R { bool operator ()(const A &amp; a, const A &amp; b) { return a.getA()&lt;b.getA();} }; inserted at \r\nPlace 2 \r\nreplacing line marked 3 with map&lt;A, string, R&gt; m; \r\nreplacing line marked 4 with map&lt;A, string,R&gt;::iterator i=m.begin();<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-2' style=';'><div id='questionWrap-2'  class='   watupro-question-id-448199'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>2. <\/span>Given three files: class.h, class.cpp and main.cpp containing small C++ project, which sentences <br \/>\r<br>are TRUE if you attempt to compile and run the program? Assume that the whole compiling <br \/>\r<br>environment is properly set. <br \/>\r<br>\/\/ File: main.cpp <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &quot;class.h&quot; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() <br \/>\r<br>{ <br \/>\r<br>A&lt;int&gt; a; <br \/>\r<br>cout &lt;&lt; a.getV() &lt;&lt; endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>\/\/File: class.h <br \/>\r<br>#ifndef _CLASS_ <br \/>\r<br>#define _CLASS_ <br \/>\r<br>template &lt;class T&gt; <br \/>\r<br>class A { <br \/>\r<br>T_v; <br \/>\r<br>public: <br \/>\r<br>A() {} <br \/>\r<br>A(T v); <br \/>\r<br>T getV(); <br \/>\r<br>}; <br \/>\r<br>#endif <br \/>\r<br>\/\/File: class.cpp <br \/>\r<br>#include &quot;class.h&quot; <br \/>\r<br>template&lt;typename T&gt; <br \/>\r<br>A&lt;T&gt;::A(T v):_v(v) {} <br \/>\r<br>template&lt;class T&gt; <br \/>\r<br>T A&lt;T&gt;::getV() { return _v; }<\/div><input type='hidden' name='question_id[]' id='qID_2' value='448199' \/><input type='hidden' id='answerType448199' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448199[]' id='answer-id-1734070' class='answer   answerof-448199 ' value='1734070'   \/><label for='answer-id-1734070' id='answer-label-1734070' class=' answer'><span>program will display: 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448199[]' id='answer-id-1734071' class='answer   answerof-448199 ' value='1734071'   \/><label for='answer-id-1734071' id='answer-label-1734071' class=' answer'><span>program will not compile<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448199[]' id='answer-id-1734072' class='answer   answerof-448199 ' value='1734072'   \/><label for='answer-id-1734072' id='answer-label-1734072' class=' answer'><span>program will display unpredictable number<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448199[]' id='answer-id-1734073' class='answer   answerof-448199 ' value='1734073'   \/><label for='answer-id-1734073' id='answer-label-1734073' class=' answer'><span>program willl be not linked<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-3' style=';'><div id='questionWrap-3'  class='   watupro-question-id-448200'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>3. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class B { int val; <br \/>\r<br>public: <br \/>\r<br>B(int v=0):val(v){} <br \/>\r<br>int getV() const {return val;} <br \/>\r<br>operator int () const { return val;} }; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>struct Add { <br \/>\r<br>B operator()(B &amp; a, B &amp; b) { return a+b; }}; <br \/>\r<br>int main() { <br \/>\r<br>int t[]={1,2,3,4,5,6,7,8,9,10}; <br \/>\r<br>vector&lt;B&gt; v1(t, t+10); <br \/>\r<br>vector&lt;B&gt; v2(10); <br \/>\r<br>transform(v1.begin(), v1.end(), v2.begin(), bind1st(1,Add())); <br \/>\r<br>for_each(v2.rbegin(), v2.rend(), Out&lt;B&gt;(cout));cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_3' value='448200' \/><input type='hidden' id='answerType448200' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448200[]' id='answer-id-1734074' class='answer   answerof-448200 ' value='1734074'   \/><label for='answer-id-1734074' id='answer-label-1734074' class=' answer'><span>1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448200[]' id='answer-id-1734075' class='answer   answerof-448200 ' value='1734075'   \/><label for='answer-id-1734075' id='answer-label-1734075' class=' answer'><span>2 3 4 5 6 7 8 9 10 11<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448200[]' id='answer-id-1734076' class='answer   answerof-448200 ' value='1734076'   \/><label for='answer-id-1734076' id='answer-label-1734076' class=' answer'><span>10 9 8 7 6 5 4 3 2 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448200[]' id='answer-id-1734077' class='answer   answerof-448200 ' value='1734077'   \/><label for='answer-id-1734077' id='answer-label-1734077' class=' answer'><span>11 10 9 8 7 6 5 4 3 2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448200[]' id='answer-id-1734078' class='answer   answerof-448200 ' value='1734078'   \/><label for='answer-id-1734078' id='answer-label-1734078' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-4' style=';'><div id='questionWrap-4'  class='   watupro-question-id-448201'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>4. <\/span>Which pieces of code inserted independently into places marked 1 and 2 will cause the program to <br \/>\r<br>compile and display: 0 1 2 3 4 5 6 7 8 9? Choose all that apply. <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class A { int a; public: <br \/>\r<br>A(int a){ this?&gt;a=a;} <br \/>\r<br>\/\/insert code here 1 <br \/>\r<br>}; <br \/>\r<br>\/\/insert code here 2 <br \/>\r<br>template&lt;class T&gt; void print(T start, T end) { <br \/>\r<br>while (start != end) { <br \/>\r<br>std::cout &lt;&lt; *start &lt;&lt; &quot; &quot;; start++; <br \/>\r<br>} <br \/>\r<br>} <br \/>\r<br>int main() { <br \/>\r<br>A t1[] ={ 1, 7, 8, 4, 5 };list&lt;A&gt; l1(t1, t1 + 5); <br \/>\r<br>A t2[] ={ 3, 2, 6, 9, 0 };list&lt;A&gt; l2(t2, t2 + 5); <br \/>\r<br>l1.sort();l2.sort();l1.merge(l2); <br \/>\r<br>print(l1.begin(), l1.end()); <br \/>\r<br>print(l2.begin(), l2.end()); cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_4' value='448201' \/><input type='hidden' id='answerType448201' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448201[]' id='answer-id-1734079' class='answer   answerof-448201 ' value='1734079'   \/><label for='answer-id-1734079' id='answer-label-1734079' class=' answer'><span>place 1: operator int() { return a; }<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448201[]' id='answer-id-1734080' class='answer   answerof-448201 ' value='1734080'   \/><label for='answer-id-1734080' id='answer-label-1734080' class=' answer'><span>place 1: operator int() { return a; } \r\nbool operator &lt; (const A &amp; b) { return this?&gt;a&lt; b.a;}<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448201[]' id='answer-id-1734081' class='answer   answerof-448201 ' value='1734081'   \/><label for='answer-id-1734081' id='answer-label-1734081' class=' answer'><span>place 1: bool operator &lt; (const A &amp; b) { return this?&gt;a&lt; b.a;}<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448201[]' id='answer-id-1734082' class='answer   answerof-448201 ' value='1734082'   \/><label for='answer-id-1734082' id='answer-label-1734082' class=' answer'><span>place 1: bool operator &lt; (const A &amp; b) { return this?&gt;a&lt; b.a;} \r\nfriend ostream &amp; operator &lt;&lt;(ostream &amp; c, const A &amp; a); \r\nplace 2: ostream &amp; operator &lt;&lt;(ostream &amp; c, const A &amp; a) { c&lt;&lt;a.a; return c;}<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448201[]' id='answer-id-1734083' class='answer   answerof-448201 ' value='1734083'   \/><label for='answer-id-1734083' id='answer-label-1734083' class=' answer'><span>place 1: bool operator &lt; (const A &amp; b) { return this?&gt;a&lt; b.a;} \r\nplace 2: ostream &amp; operator &lt;&lt;(ostream &amp; c, const A &amp; a) { c&lt;&lt;a.a; return c;}<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-5' style=';'><div id='questionWrap-5'  class='   watupro-question-id-448202'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>5. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>int main() { <br \/>\r<br>int t1[]={3,2,4,1,5}; <br \/>\r<br>int t2[]={5,6,8,2,1}; <br \/>\r<br>vector&lt;int&gt; v1(10); <br \/>\r<br>sort(t1, t1+5); <br \/>\r<br>sort(t2, t2+5); <br \/>\r<br>set_intersection(t1,t1+5,t2,t2+5,v1.begin()); <br \/>\r<br>for_each(v1.begin(), v1.end(), Out&lt;int&gt;(cout));cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_5' value='448202' \/><input type='hidden' id='answerType448202' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448202[]' id='answer-id-1734084' class='answer   answerof-448202 ' value='1734084'   \/><label for='answer-id-1734084' id='answer-label-1734084' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448202[]' id='answer-id-1734085' class='answer   answerof-448202 ' value='1734085'   \/><label for='answer-id-1734085' id='answer-label-1734085' class=' answer'><span>1 2 3 4 5 6 8 0 0 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448202[]' id='answer-id-1734086' class='answer   answerof-448202 ' value='1734086'   \/><label for='answer-id-1734086' id='answer-label-1734086' class=' answer'><span>1 2 3 4 5 6 8 2 1 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448202[]' id='answer-id-1734087' class='answer   answerof-448202 ' value='1734087'   \/><label for='answer-id-1734087' id='answer-label-1734087' class=' answer'><span>1 1 2 2 3 4 5 5 6 8<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448202[]' id='answer-id-1734088' class='answer   answerof-448202 ' value='1734088'   \/><label for='answer-id-1734088' id='answer-label-1734088' class=' answer'><span>1 2 5 0 0 0 0 0 0 0<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-6' style=';'><div id='questionWrap-6'  class='   watupro-question-id-448203'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>6. <\/span>Which stack initialization (line numbers) are correct? Choose all that apply. <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;stack&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() <br \/>\r<br>{ <br \/>\r<br>deque&lt;int&gt; mydeck; <br \/>\r<br>list&lt;int&gt; mylist; <br \/>\r<br>vector&lt;int&gt; myvector; <br \/>\r<br>stack&lt;int&gt; first;\/\/ Line I <br \/>\r<br>stack&lt;int&gt; second(mydeck);\/\/ Line II <br \/>\r<br>stack&lt;int&gt; third(second);\/\/ Line III <br \/>\r<br>stack&lt;int, list&lt;int&gt; &gt; fourth(mylist);\/\/ Line IV <br \/>\r<br>stack&lt;int, vector&lt;int&gt; &gt; fifth(myvector);\/\/ Line V <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_6' value='448203' \/><input type='hidden' id='answerType448203' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448203[]' id='answer-id-1734089' class='answer   answerof-448203 ' value='1734089'   \/><label for='answer-id-1734089' id='answer-label-1734089' class=' answer'><span>line I<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448203[]' id='answer-id-1734090' class='answer   answerof-448203 ' value='1734090'   \/><label for='answer-id-1734090' id='answer-label-1734090' class=' answer'><span>line II<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448203[]' id='answer-id-1734091' class='answer   answerof-448203 ' value='1734091'   \/><label for='answer-id-1734091' id='answer-label-1734091' class=' answer'><span>line III<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448203[]' id='answer-id-1734092' class='answer   answerof-448203 ' value='1734092'   \/><label for='answer-id-1734092' id='answer-label-1734092' class=' answer'><span>line IV<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448203[]' id='answer-id-1734093' class='answer   answerof-448203 ' value='1734093'   \/><label for='answer-id-1734093' id='answer-label-1734093' class=' answer'><span>line V<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-7' style=';'><div id='questionWrap-7'  class='   watupro-question-id-448204'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>7. <\/span>What will happen when you attempt to compile and run the code below, assuming that you enter <br \/>\r<br>the following sequence: one two three&lt;enter&gt;? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>string a; <br \/>\r<br>cin&gt;&gt;a; <br \/>\r<br>cout&lt;&lt;a&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program will output:<\/div><input type='hidden' name='question_id[]' id='qID_7' value='448204' \/><input type='hidden' id='answerType448204' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448204[]' id='answer-id-1734094' class='answer   answerof-448204 ' value='1734094'   \/><label for='answer-id-1734094' id='answer-label-1734094' class=' answer'><span>one<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448204[]' id='answer-id-1734095' class='answer   answerof-448204 ' value='1734095'   \/><label for='answer-id-1734095' id='answer-label-1734095' class=' answer'><span>one two three<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448204[]' id='answer-id-1734096' class='answer   answerof-448204 ' value='1734096'   \/><label for='answer-id-1734096' id='answer-label-1734096' class=' answer'><span>runtime exception<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448204[]' id='answer-id-1734097' class='answer   answerof-448204 ' value='1734097'   \/><label for='answer-id-1734097' id='answer-label-1734097' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448204[]' id='answer-id-1734098' class='answer   answerof-448204 ' value='1734098'   \/><label for='answer-id-1734098' id='answer-label-1734098' class=' answer'><span>the result is unspecified<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-8' style=';'><div id='questionWrap-8'  class='   watupro-question-id-448205'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>8. <\/span>Which sentence is correct about the code below? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class A { <br \/>\r<br>int a; <br \/>\r<br>public: <br \/>\r<br>A(int a) : a(a) {} <br \/>\r<br>int getA() const { return a; } <br \/>\r<br>void setA(int a) { this?&gt;a = a; } <br \/>\r<br>\/* Insert Code Here *\/ <br \/>\r<br>}; <br \/>\r<br>struct add10 { void operator()(A &amp; a) { a.setA(a.getA() + 10); } }; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>vector&lt;A&gt; v1(t, t + 10); <br \/>\r<br>for_each(v1.begin(), v1.end(), add10()); <br \/>\r<br>vector&lt;A&gt;::iterator it = find(v1.begin(), v1.end(), A(7)); <br \/>\r<br>cout &lt;&lt; it?&gt;getA() &lt;&lt; endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_8' value='448205' \/><input type='hidden' id='answerType448205' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448205[]' id='answer-id-1734099' class='answer   answerof-448205 ' value='1734099'   \/><label for='answer-id-1734099' id='answer-label-1734099' class=' answer'><span>it will compile and print 7<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448205[]' id='answer-id-1734100' class='answer   answerof-448205 ' value='1734100'   \/><label for='answer-id-1734100' id='answer-label-1734100' class=' answer'><span>it will not compile<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448205[]' id='answer-id-1734101' class='answer   answerof-448205 ' value='1734101'   \/><label for='answer-id-1734101' id='answer-label-1734101' class=' answer'><span>it will compile but the program result is unpredictable<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448205[]' id='answer-id-1734102' class='answer   answerof-448205 ' value='1734102'   \/><label for='answer-id-1734102' id='answer-label-1734102' class=' answer'><span>adding code: \r\nbool operator !=(const A &amp; b) const { \r\nif (this?&gt;a != b.a) { return true; } return false; } \r\nat Place 1 will allow the program to compile<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-9' style=';'><div id='questionWrap-9'  class='   watupro-question-id-448206'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>9. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;map&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 }; <br \/>\r<br>string s[] = { &quot;one&quot;, &quot;one&quot;, &quot;two&quot;, &quot;two&quot;, &quot;three&quot;,&quot;three&quot;, &quot;four&quot;, &quot;four&quot;, &quot;five&quot;, &quot;five&quot;}; <br \/>\r<br>map&lt;int, string&gt; m; <br \/>\r<br>for (int i = 0; i &lt; 10; i++) { <br \/>\r<br>m.push_back(pair&lt;int, string&gt;(t[i], s[i])); <br \/>\r<br>} <br \/>\r<br>for (map&lt;int, string&gt;::iterator i = m.begin(); i != m.end(); i++) { <br \/>\r<br>cout &lt;&lt; i?&gt;first &lt;&lt; &quot; &quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_9' value='448206' \/><input type='hidden' id='answerType448206' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448206[]' id='answer-id-1734103' class='answer   answerof-448206 ' value='1734103'   \/><label for='answer-id-1734103' id='answer-label-1734103' class=' answer'><span>program outputs: 1 2 3 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448206[]' id='answer-id-1734104' class='answer   answerof-448206 ' value='1734104'   \/><label for='answer-id-1734104' id='answer-label-1734104' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448206[]' id='answer-id-1734105' class='answer   answerof-448206 ' value='1734105'   \/><label for='answer-id-1734105' id='answer-label-1734105' class=' answer'><span>program outputs: 1 1 2 2 3 3 4 4 5 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448206[]' id='answer-id-1734106' class='answer   answerof-448206 ' value='1734106'   \/><label for='answer-id-1734106' id='answer-label-1734106' class=' answer'><span>program outputs: one two three four five<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448206[]' id='answer-id-1734107' class='answer   answerof-448206 ' value='1734107'   \/><label for='answer-id-1734107' id='answer-label-1734107' class=' answer'><span>program outputs: one one two two three three four four five five<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-10' style=';'><div id='questionWrap-10'  class='   watupro-question-id-448207'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>10. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class B { int val; <br \/>\r<br>public: <br \/>\r<br>B(int v):val(v){} <br \/>\r<br>int getV() const {return val;} bool operator &lt; (const B &amp; v) const { return val&lt;v.val;} }; <br \/>\r<br>ostream &amp; operator &lt;&lt;(ostream &amp; out, const B &amp; v) { out&lt;&lt;v.getV(); return out;} <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>int main() { <br \/>\r<br>int t[]={8, 10, 5, 1, 4, 6, 2, 7, 9, 3}; <br \/>\r<br>deque&lt;B&gt; d1(t, t+10); <br \/>\r<br>sort(d1.begin(), d1.end()); <br \/>\r<br>deque&lt;B&gt;::iterator it = upper_bound(d1.begin(), d1.end(), B(4)); <br \/>\r<br>for_each(it, d1.end(), Out&lt;B&gt;(cout)); cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_10' value='448207' \/><input type='hidden' id='answerType448207' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448207[]' id='answer-id-1734108' class='answer   answerof-448207 ' value='1734108'   \/><label for='answer-id-1734108' id='answer-label-1734108' class=' answer'><span>5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448207[]' id='answer-id-1734109' class='answer   answerof-448207 ' value='1734109'   \/><label for='answer-id-1734109' id='answer-label-1734109' class=' answer'><span>4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448207[]' id='answer-id-1734110' class='answer   answerof-448207 ' value='1734110'   \/><label for='answer-id-1734110' id='answer-label-1734110' class=' answer'><span>6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448207[]' id='answer-id-1734111' class='answer   answerof-448207 ' value='1734111'   \/><label for='answer-id-1734111' id='answer-label-1734111' class=' answer'><span>1 2 3 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448207[]' id='answer-id-1734112' class='answer   answerof-448207 ' value='1734112'   \/><label for='answer-id-1734112' id='answer-label-1734112' class=' answer'><span>1 2 3 4<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-11' style=';'><div id='questionWrap-11'  class='   watupro-question-id-448208'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>11. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class B { int val; <br \/>\r<br>public: <br \/>\r<br>B(int v):val(v){} <br \/>\r<br>int getV() const {return val;} bool operator &lt; (const B &amp; v) const { return val&lt;v.val;} }; <br \/>\r<br>ostream &amp; operator &lt;&lt;(ostream &amp; out, const B &amp; v) { out&lt;&lt;v.getV(); return out;} <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>int main() { <br \/>\r<br>B t1[]={3,2,4,1,5}; <br \/>\r<br>int t2[]={5,6,8,2,1}; <br \/>\r<br>vector&lt;B&gt; v1(10,0); <br \/>\r<br>sort(t1, t1+5); <br \/>\r<br>sort(t2, t2+5); <br \/>\r<br>set_union(t1,t1+5,t2,t2+5,v1.begin()); <br \/>\r<br>for_each(v1.begin(), v1.end(), Out&lt;B&gt;(cout));cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_11' value='448208' \/><input type='hidden' id='answerType448208' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448208[]' id='answer-id-1734113' class='answer   answerof-448208 ' value='1734113'   \/><label for='answer-id-1734113' id='answer-label-1734113' class=' answer'><span>3 2 4 1 5 6 8 2 1 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448208[]' id='answer-id-1734114' class='answer   answerof-448208 ' value='1734114'   \/><label for='answer-id-1734114' id='answer-label-1734114' class=' answer'><span>1 2 3 4 5 6 8 2 1 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448208[]' id='answer-id-1734115' class='answer   answerof-448208 ' value='1734115'   \/><label for='answer-id-1734115' id='answer-label-1734115' class=' answer'><span>1 1 2 2 3 4 5 5 6 8<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448208[]' id='answer-id-1734116' class='answer   answerof-448208 ' value='1734116'   \/><label for='answer-id-1734116' id='answer-label-1734116' class=' answer'><span>1 2 3 4 5 6 8 0 0 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448208[]' id='answer-id-1734117' class='answer   answerof-448208 ' value='1734117'   \/><label for='answer-id-1734117' id='answer-label-1734117' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-12' style=';'><div id='questionWrap-12'  class='   watupro-question-id-448209'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>12. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>std::vector&lt;int&gt;v1; <br \/>\r<br>v1.push_back(10); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_12' value='448209' \/><input type='hidden' id='answerType448209' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448209[]' id='answer-id-1734118' class='answer   answerof-448209 ' value='1734118'   \/><label for='answer-id-1734118' id='answer-label-1734118' class=' answer'><span>compilation fails due to error in line 2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448209[]' id='answer-id-1734119' class='answer   answerof-448209 ' value='1734119'   \/><label for='answer-id-1734119' id='answer-label-1734119' class=' answer'><span>compilation fails due to error in line 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448209[]' id='answer-id-1734120' class='answer   answerof-448209 ' value='1734120'   \/><label for='answer-id-1734120' id='answer-label-1734120' class=' answer'><span>exception is thrown during run time<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448209[]' id='answer-id-1734121' class='answer   answerof-448209 ' value='1734121'   \/><label for='answer-id-1734121' id='answer-label-1734121' class=' answer'><span>code compiles and executes successfully<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-13' style=';'><div id='questionWrap-13'  class='   watupro-question-id-448210'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>13. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template &lt;class T&gt; <br \/>\r<br>class A { <br \/>\r<br>T_v; <br \/>\r<br>public: <br \/>\r<br>A() {} <br \/>\r<br>A(T v): _v(v){} <br \/>\r<br>T getV() { return _v; } <br \/>\r<br>void add(T &amp; a) { _v+=a; } <br \/>\r<br>void add(string &amp; a) { <br \/>\r<br>_v.insert(0, a); <br \/>\r<br>} <br \/>\r<br>}; <br \/>\r<br>int main() <br \/>\r<br>{ <br \/>\r<br>A&lt;string&gt;a(&quot;Hello&quot;); <br \/>\r<br>string s(&quot; world!&quot;); <br \/>\r<br>a.add(s); <br \/>\r<br>cout &lt;&lt; a.getV() &lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_13' value='448210' \/><input type='hidden' id='answerType448210' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448210[]' id='answer-id-1734122' class='answer   answerof-448210 ' value='1734122'   \/><label for='answer-id-1734122' id='answer-label-1734122' class=' answer'><span>program will display: Hello world!<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448210[]' id='answer-id-1734123' class='answer   answerof-448210 ' value='1734123'   \/><label for='answer-id-1734123' id='answer-label-1734123' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448210[]' id='answer-id-1734124' class='answer   answerof-448210 ' value='1734124'   \/><label for='answer-id-1734124' id='answer-label-1734124' class=' answer'><span>program will display: world!Hello<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448210[]' id='answer-id-1734125' class='answer   answerof-448210 ' value='1734125'   \/><label for='answer-id-1734125' id='answer-label-1734125' class=' answer'><span>program will run without any output<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-14' style=';'><div id='questionWrap-14'  class='   watupro-question-id-448211'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>14. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>list&lt;int&gt;l1; <br \/>\r<br>deque&lt;int&gt;d1; <br \/>\r<br>for(int i=0; i&lt;5; i++) <br \/>\r<br>{ <br \/>\r<br>l1.push_back(i);l1.push_front(i); <br \/>\r<br>d1.push_back(i);d1.push_front(i); <br \/>\r<br>} <br \/>\r<br>for(int i=0; i&lt;d1.size(); i++) <br \/>\r<br>{ <br \/>\r<br>cout&lt;&lt;d1[i]&lt;&lt;&quot; &quot;&lt;&lt;l1[i]&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_14' value='448211' \/><input type='hidden' id='answerType448211' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448211[]' id='answer-id-1734126' class='answer   answerof-448211 ' value='1734126'   \/><label for='answer-id-1734126' id='answer-label-1734126' class=' answer'><span>program displays 4 4 3 3 2 2 1 1 0 0 0 0 1 1 2 2 3 3 4 4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448211[]' id='answer-id-1734127' class='answer   answerof-448211 ' value='1734127'   \/><label for='answer-id-1734127' id='answer-label-1734127' class=' answer'><span>runtime exception<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448211[]' id='answer-id-1734128' class='answer   answerof-448211 ' value='1734128'   \/><label for='answer-id-1734128' id='answer-label-1734128' class=' answer'><span>compilation error due to line 11<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448211[]' id='answer-id-1734129' class='answer   answerof-448211 ' value='1734129'   \/><label for='answer-id-1734129' id='answer-label-1734129' class=' answer'><span>compilation error due to line 12<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448211[]' id='answer-id-1734130' class='answer   answerof-448211 ' value='1734130'   \/><label for='answer-id-1734130' id='answer-label-1734130' class=' answer'><span>compilation error due to line 16<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-15' style=';'><div id='questionWrap-15'  class='   watupro-question-id-448212'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>15. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;typename T&gt; <br \/>\r<br>void print(T start, T end) <br \/>\r<br>{ <br \/>\r<br>while (start != end) <br \/>\r<br>cout&lt;&lt;*start++; <br \/>\r<br>} <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>string t[] = {&quot;one&quot;, &quot;two&quot; ,&quot;three&quot; ,&quot;four&quot;, &quot;five&quot;}; <br \/>\r<br>vector&lt;string&gt;v1(t, t+5); <br \/>\r<br>deque&lt;string&gt;d1(v1.rbegin(), v1.rend()); <br \/>\r<br>d1.push_back(&quot;zero&quot;); <br \/>\r<br>print(d1[0].rbegin(),d1[0].rend()); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_15' value='448212' \/><input type='hidden' id='answerType448212' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448212[]' id='answer-id-1734131' class='answer   answerof-448212 ' value='1734131'   \/><label for='answer-id-1734131' id='answer-label-1734131' class=' answer'><span>program outputs: orez<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448212[]' id='answer-id-1734132' class='answer   answerof-448212 ' value='1734132'   \/><label for='answer-id-1734132' id='answer-label-1734132' class=' answer'><span>program outputs: evif<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448212[]' id='answer-id-1734133' class='answer   answerof-448212 ' value='1734133'   \/><label for='answer-id-1734133' id='answer-label-1734133' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448212[]' id='answer-id-1734134' class='answer   answerof-448212 ' value='1734134'   \/><label for='answer-id-1734134' id='answer-label-1734134' class=' answer'><span>program outputs: five<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-16' style=';'><div id='questionWrap-16'  class='   watupro-question-id-448213'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>16. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1,2,3,4,5,1,2,3,4,5}; <br \/>\r<br>vector&lt;int&gt; v (t,t+10); <br \/>\r<br>vector&lt;int&gt;::iterator it; <br \/>\r<br>int m1[] = {1, 2, 3}; <br \/>\r<br>it = search (v.begin(), v.end(), m1, m1+3); <br \/>\r<br>cout &lt;&lt; &quot;found at position: &quot; &lt;&lt; it?v.begin() &lt;&lt; endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_16' value='448213' \/><input type='hidden' id='answerType448213' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448213[]' id='answer-id-1734135' class='answer   answerof-448213 ' value='1734135'   \/><label for='answer-id-1734135' id='answer-label-1734135' class=' answer'><span>found at position: 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448213[]' id='answer-id-1734136' class='answer   answerof-448213 ' value='1734136'   \/><label for='answer-id-1734136' id='answer-label-1734136' class=' answer'><span>found at position: 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448213[]' id='answer-id-1734137' class='answer   answerof-448213 ' value='1734137'   \/><label for='answer-id-1734137' id='answer-label-1734137' class=' answer'><span>found at position: 6<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448213[]' id='answer-id-1734138' class='answer   answerof-448213 ' value='1734138'   \/><label for='answer-id-1734138' id='answer-label-1734138' class=' answer'><span>found at position: 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448213[]' id='answer-id-1734139' class='answer   answerof-448213 ' value='1734139'   \/><label for='answer-id-1734139' id='answer-label-1734139' class=' answer'><span>found at position: 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-17' style=';'><div id='questionWrap-17'  class='   watupro-question-id-448214'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>17. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class A { <br \/>\r<br>int a; <br \/>\r<br>public: <br \/>\r<br>A(int a) : a(a) {} <br \/>\r<br>int getA() const { return a; } void setA(int a) { this?&gt;a = a; } <br \/>\r<br>}; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5}; <br \/>\r<br>deque&lt;int&gt; d (t,t+15); <br \/>\r<br>int number = count(d.begin(), d.end(), 2); <br \/>\r<br>cout&lt;&lt; number&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_17' value='448214' \/><input type='hidden' id='answerType448214' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448214[]' id='answer-id-1734140' class='answer   answerof-448214 ' value='1734140'   \/><label for='answer-id-1734140' id='answer-label-1734140' class=' answer'><span>4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448214[]' id='answer-id-1734141' class='answer   answerof-448214 ' value='1734141'   \/><label for='answer-id-1734141' id='answer-label-1734141' class=' answer'><span>3<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448214[]' id='answer-id-1734142' class='answer   answerof-448214 ' value='1734142'   \/><label for='answer-id-1734142' id='answer-label-1734142' class=' answer'><span>2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448214[]' id='answer-id-1734143' class='answer   answerof-448214 ' value='1734143'   \/><label for='answer-id-1734143' id='answer-label-1734143' class=' answer'><span>0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448214[]' id='answer-id-1734144' class='answer   answerof-448214 ' value='1734144'   \/><label for='answer-id-1734144' id='answer-label-1734144' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-18' style=';'><div id='questionWrap-18'  class='   watupro-question-id-448215'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>18. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1,2,3,4,5,1,2,3,5,4}; <br \/>\r<br>vector&lt;int&gt; v (t,t+10); <br \/>\r<br>vector&lt;int&gt;::iterator it; <br \/>\r<br>int m1[] = {1, 3, 2}; <br \/>\r<br>it = find_end (v.begin(), v.end(), m1, m1+3); <br \/>\r<br>if (it != v.end()) <br \/>\r<br>cout &lt;&lt; &quot;Found at position: &quot; &lt;&lt; it?v.begin() &lt;&lt; endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_18' value='448215' \/><input type='hidden' id='answerType448215' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448215[]' id='answer-id-1734145' class='answer   answerof-448215 ' value='1734145'   \/><label for='answer-id-1734145' id='answer-label-1734145' class=' answer'><span>program outputs: Found at position: 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448215[]' id='answer-id-1734146' class='answer   answerof-448215 ' value='1734146'   \/><label for='answer-id-1734146' id='answer-label-1734146' class=' answer'><span>program outputs: Found at position: 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448215[]' id='answer-id-1734147' class='answer   answerof-448215 ' value='1734147'   \/><label for='answer-id-1734147' id='answer-label-1734147' class=' answer'><span>no output<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448215[]' id='answer-id-1734148' class='answer   answerof-448215 ' value='1734148'   \/><label for='answer-id-1734148' id='answer-label-1734148' class=' answer'><span>program outputs: Found at position: 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-19' style=';'><div id='questionWrap-19'  class='   watupro-question-id-448216'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>19. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;fstream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;iomanip&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class B { int val; <br \/>\r<br>public: <br \/>\r<br>B(int v=0):val(v){} <br \/>\r<br>int getV() const {return val;} <br \/>\r<br>operator int() const { return val; };}; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) {out&lt;&lt;setw(3)&lt;&lt;hex&lt;&lt;val; } }; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; <br \/>\r<br>fstream f(&quot;test.out&quot;, ios::trunc|ios::out); <br \/>\r<br>list&lt;B&gt; l(t, t+10); <br \/>\r<br>for_each(l.begin(), l.end(), Out&lt;B&gt;(f)); <br \/>\r<br>f.close(); <br \/>\r<br>f.open(&quot;test.out&quot;); <br \/>\r<br>for( ; f.good() ; ) { <br \/>\r<br>B i; <br \/>\r<br>f&gt;&gt;i; <br \/>\r<br>cout&lt;&lt;i&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>f.close(); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_19' value='448216' \/><input type='hidden' id='answerType448216' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448216[]' id='answer-id-1734149' class='answer   answerof-448216 ' value='1734149'   \/><label for='answer-id-1734149' id='answer-label-1734149' class=' answer'><span>file test.out will be opened writing<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448216[]' id='answer-id-1734150' class='answer   answerof-448216 ' value='1734150'   \/><label for='answer-id-1734150' id='answer-label-1734150' class=' answer'><span>file test.out will be truncated<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448216[]' id='answer-id-1734151' class='answer   answerof-448216 ' value='1734151'   \/><label for='answer-id-1734151' id='answer-label-1734151' class=' answer'><span>file test.out will be opened for reading<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448216[]' id='answer-id-1734152' class='answer   answerof-448216 ' value='1734152'   \/><label for='answer-id-1734152' id='answer-label-1734152' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448216[]' id='answer-id-1734153' class='answer   answerof-448216 ' value='1734153'   \/><label for='answer-id-1734153' id='answer-label-1734153' class=' answer'><span>program will display sequence 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-20' style=';'><div id='questionWrap-20'  class='   watupro-question-id-448217'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>20. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;set&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>struct display { <br \/>\r<br>void operator() (int i) {cout &lt;&lt; &quot; &quot; &lt;&lt; i;} <br \/>\r<br>}; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>vector&lt;int&gt; v1(t, t + 10); <br \/>\r<br>deque&lt;int&gt; d1(t, t + 10); <br \/>\r<br>set&lt;int&gt; s1(t, t + 10); <br \/>\r<br>for_each(v1.begin(), v1.end(), display); \/\/Line I <br \/>\r<br>for_each(d1.begin(), d1.end(), *(new display())); \/\/ Line II <br \/>\r<br>for_each(s1.begin(), s1.end(), display()); \/\/ Line III <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_20' value='448217' \/><input type='hidden' id='answerType448217' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448217[]' id='answer-id-1734154' class='answer   answerof-448217 ' value='1734154'   \/><label for='answer-id-1734154' id='answer-label-1734154' class=' answer'><span>program outputs: 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448217[]' id='answer-id-1734155' class='answer   answerof-448217 ' value='1734155'   \/><label for='answer-id-1734155' id='answer-label-1734155' class=' answer'><span>program outputs: 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1 10 5 9 6 2 4 7 8 3 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448217[]' id='answer-id-1734156' class='answer   answerof-448217 ' value='1734156'   \/><label for='answer-id-1734156' id='answer-label-1734156' class=' answer'><span>compilation error in line I<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448217[]' id='answer-id-1734157' class='answer   answerof-448217 ' value='1734157'   \/><label for='answer-id-1734157' id='answer-label-1734157' class=' answer'><span>compilation error in line II<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448217[]' id='answer-id-1734158' class='answer   answerof-448217 ' value='1734158'   \/><label for='answer-id-1734158' id='answer-label-1734158' class=' answer'><span>compilation error in line III<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-21' style=';'><div id='questionWrap-21'  class='   watupro-question-id-448218'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>21. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator()(const T &amp; val ) { <br \/>\r<br>out&lt;&lt;val&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>}; <br \/>\r<br>struct Sequence { <br \/>\r<br>int start; <br \/>\r<br>Sequence(int start):start(start){} <br \/>\r<br>int operator()() { <br \/>\r<br>return start++ ; }}; <br \/>\r<br>int main() { <br \/>\r<br>vector&lt;int&gt; v1(10); <br \/>\r<br>generate(v1.rbegin(), v1.rend(), Sequence(1)); <br \/>\r<br>rotate(v1.begin(),v1.begin() + 1, v1.end() ); <br \/>\r<br>for_each(v1.begin(), v1.end(), Out&lt;int&gt;(cout) );cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_21' value='448218' \/><input type='hidden' id='answerType448218' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448218[]' id='answer-id-1734159' class='answer   answerof-448218 ' value='1734159'   \/><label for='answer-id-1734159' id='answer-label-1734159' class=' answer'><span>1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448218[]' id='answer-id-1734160' class='answer   answerof-448218 ' value='1734160'   \/><label for='answer-id-1734160' id='answer-label-1734160' class=' answer'><span>10 9 8 7 6 5 4 3 2 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448218[]' id='answer-id-1734161' class='answer   answerof-448218 ' value='1734161'   \/><label for='answer-id-1734161' id='answer-label-1734161' class=' answer'><span>9 8 7 6 5 4 3 2 1 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448218[]' id='answer-id-1734162' class='answer   answerof-448218 ' value='1734162'   \/><label for='answer-id-1734162' id='answer-label-1734162' class=' answer'><span>1 10 9 8 7 6 5 4 3 2<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-22' style=';'><div id='questionWrap-22'  class='   watupro-question-id-448219'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>22. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt; void print(T start, T end) { <br \/>\r<br>while (start != end) { <br \/>\r<br>std::cout &lt;&lt; *start &lt;&lt; &quot; &quot;; start++; <br \/>\r<br>} <br \/>\r<br>} <br \/>\r<br>class A { <br \/>\r<br>int a; <br \/>\r<br>public: <br \/>\r<br>A(int a):a(a){} <br \/>\r<br>operator int () const { return a;}int getA() const { return a;} <br \/>\r<br>}; <br \/>\r<br>struct R { <br \/>\r<br>int val; <br \/>\r<br>R(int v):val(v){} <br \/>\r<br>bool operator ()(const A &amp; a) { return a&gt;val;} }; <br \/>\r<br>int main() { <br \/>\r<br>int t1[] ={ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; <br \/>\r<br>list&lt;A&gt; l1(t1, t1 + 10); <br \/>\r<br>R r(4);l1.remove_if(r); <br \/>\r<br>print(l1.begin(), l1.end()); cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_22' value='448219' \/><input type='hidden' id='answerType448219' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448219[]' id='answer-id-1734163' class='answer   answerof-448219 ' value='1734163'   \/><label for='answer-id-1734163' id='answer-label-1734163' class=' answer'><span>program outputs: 1 2 3 4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448219[]' id='answer-id-1734164' class='answer   answerof-448219 ' value='1734164'   \/><label for='answer-id-1734164' id='answer-label-1734164' class=' answer'><span>program outputs: 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448219[]' id='answer-id-1734165' class='answer   answerof-448219 ' value='1734165'   \/><label for='answer-id-1734165' id='answer-label-1734165' class=' answer'><span>program outputs: 1 2 3 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448219[]' id='answer-id-1734166' class='answer   answerof-448219 ' value='1734166'   \/><label for='answer-id-1734166' id='answer-label-1734166' class=' answer'><span>program outputs: 6 7 8 9 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-23' style=';'><div id='questionWrap-23'  class='   watupro-question-id-448220'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>23. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;functional&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>int Add(int a, int b) { <br \/>\r<br>return a+b; <br \/>\r<br>} <br \/>\r<br>int main() { <br \/>\r<br>int t[]={1,2,3,4,5,6,7,8,9,10}; <br \/>\r<br>vector&lt;int&gt; v1(t, t+10); <br \/>\r<br>vector&lt;int&gt; v2(10); <br \/>\r<br>transform(v1.begin(), v1.end(), v2.begin(), bind2nd(ptr_fun (Add),1)); <br \/>\r<br>vector&lt;int&gt;::iterator it = find_if(v2.begin(), v2.end(),bind2nd(equal_to&lt;int&gt;(),10)); <br \/>\r<br>cout&lt;&lt;*it&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_23' value='448220' \/><input type='hidden' id='answerType448220' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448220[]' id='answer-id-1734167' class='answer   answerof-448220 ' value='1734167'   \/><label for='answer-id-1734167' id='answer-label-1734167' class=' answer'><span>false<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448220[]' id='answer-id-1734168' class='answer   answerof-448220 ' value='1734168'   \/><label for='answer-id-1734168' id='answer-label-1734168' class=' answer'><span>true<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448220[]' id='answer-id-1734169' class='answer   answerof-448220 ' value='1734169'   \/><label for='answer-id-1734169' id='answer-label-1734169' class=' answer'><span>10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448220[]' id='answer-id-1734170' class='answer   answerof-448220 ' value='1734170'   \/><label for='answer-id-1734170' id='answer-label-1734170' class=' answer'><span>0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448220[]' id='answer-id-1734171' class='answer   answerof-448220 ' value='1734171'   \/><label for='answer-id-1734171' id='answer-label-1734171' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-24' style=';'><div id='questionWrap-24'  class='   watupro-question-id-448221'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>24. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>int main() { <br \/>\r<br>int t1[]={3,2,4,1,5}; <br \/>\r<br>int t2[]={6,10,8,7,9}; <br \/>\r<br>vector&lt;int&gt; v1(10); <br \/>\r<br>sort(t1, t1+5); sort(t2, t2+5); <br \/>\r<br>copy(t1,t1+5,v1.begin()); <br \/>\r<br>copy(t2,t2+5,v1.begin()+5); <br \/>\r<br>merge(v1.begin(), v1.begin()+5,v1.end()); <br \/>\r<br>for_each(v1.begin(), v1.end(), Out&lt;int&gt;(cout));cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_24' value='448221' \/><input type='hidden' id='answerType448221' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448221[]' id='answer-id-1734172' class='answer   answerof-448221 ' value='1734172'   \/><label for='answer-id-1734172' id='answer-label-1734172' class=' answer'><span>1 2 3 4 5 6 10 8 7 9<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448221[]' id='answer-id-1734173' class='answer   answerof-448221 ' value='1734173'   \/><label for='answer-id-1734173' id='answer-label-1734173' class=' answer'><span>3 2 4 1 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448221[]' id='answer-id-1734174' class='answer   answerof-448221 ' value='1734174'   \/><label for='answer-id-1734174' id='answer-label-1734174' class=' answer'><span>3 2 4 1 5 6 10 8 7 9<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448221[]' id='answer-id-1734175' class='answer   answerof-448221 ' value='1734175'   \/><label for='answer-id-1734175' id='answer-label-1734175' class=' answer'><span>1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448221[]' id='answer-id-1734176' class='answer   answerof-448221 ' value='1734176'   \/><label for='answer-id-1734176' id='answer-label-1734176' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-25' style=';'><div id='questionWrap-25'  class='   watupro-question-id-448222'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>25. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>void myfunction(int i) { <br \/>\r<br>cout &lt;&lt; &quot; &quot; &lt;&lt; i; <br \/>\r<br>} <br \/>\r<br>void multiply (int a) { <br \/>\r<br>a*2; <br \/>\r<br>} <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>vector&lt;int&gt; v1(t, t+10); <br \/>\r<br>for_each(v1.begin(), v1.end(), multiply); <br \/>\r<br>iter_swap(v1.begin(),t+9); <br \/>\r<br>for_each(v1.begin(), v1.end(), myfunction); <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_25' value='448222' \/><input type='hidden' id='answerType448222' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448222[]' id='answer-id-1734177' class='answer   answerof-448222 ' value='1734177'   \/><label for='answer-id-1734177' id='answer-label-1734177' class=' answer'><span>1 5 9 6 2 4 7 8 3 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448222[]' id='answer-id-1734178' class='answer   answerof-448222 ' value='1734178'   \/><label for='answer-id-1734178' id='answer-label-1734178' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448222[]' id='answer-id-1734179' class='answer   answerof-448222 ' value='1734179'   \/><label for='answer-id-1734179' id='answer-label-1734179' class=' answer'><span>1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448222[]' id='answer-id-1734180' class='answer   answerof-448222 ' value='1734180'   \/><label for='answer-id-1734180' id='answer-label-1734180' class=' answer'><span>10 9 8 7 6 5 4 3 2 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448222[]' id='answer-id-1734181' class='answer   answerof-448222 ' value='1734181'   \/><label for='answer-id-1734181' id='answer-label-1734181' class=' answer'><span>10 5 9 6 2 4 7 8 3 1<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-26' style=';'><div id='questionWrap-26'  class='   watupro-question-id-448223'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>26. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>void myfunction(int i) { <br \/>\r<br>cout &lt;&lt; &quot; &quot; &lt;&lt; i; <br \/>\r<br>} <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>deque&lt;int&gt; d1(t, t+10); <br \/>\r<br>vector&lt;int&gt; v1(d1.rbegin(), d1.rend()); <br \/>\r<br>sort(d1.begin(), d1.end()); <br \/>\r<br>swap_ranges(v1.begin(), v1.end(), d1.begin()); <br \/>\r<br>for_each(v1.begin(), v1.end(), myfunction); <br \/>\r<br>for_each(d1.begin(), d1.end(), myfunction); <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_26' value='448223' \/><input type='hidden' id='answerType448223' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448223[]' id='answer-id-1734182' class='answer   answerof-448223 ' value='1734182'   \/><label for='answer-id-1734182' id='answer-label-1734182' class=' answer'><span>10 9 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448223[]' id='answer-id-1734183' class='answer   answerof-448223 ' value='1734183'   \/><label for='answer-id-1734183' id='answer-label-1734183' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448223[]' id='answer-id-1734184' class='answer   answerof-448223 ' value='1734184'   \/><label for='answer-id-1734184' id='answer-label-1734184' class=' answer'><span>1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448223[]' id='answer-id-1734185' class='answer   answerof-448223 ' value='1734185'   \/><label for='answer-id-1734185' id='answer-label-1734185' class=' answer'><span>1 2 3 4 5 6 7 8 9 10 1 3 8 7 4 2 6 9 5 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448223[]' id='answer-id-1734186' class='answer   answerof-448223 ' value='1734186'   \/><label for='answer-id-1734186' id='answer-label-1734186' class=' answer'><span>1 3 8 7 4 2 6 9 5 10 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-27' style=';'><div id='questionWrap-27'  class='   watupro-question-id-448224'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>27. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;functional&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) { out&lt;&lt;val&lt;&lt;&quot; &quot;; } }; <br \/>\r<br>struct Add : public binary_function&lt;int, int, int&gt; { <br \/>\r<br>int operator() (const int &amp; a, const int &amp; b) const { <br \/>\r<br>return a+b; <br \/>\r<br>} <br \/>\r<br>}; <br \/>\r<br>int main() { <br \/>\r<br>int t[]={1,2,3,4,5,6,7,8,9,10}; <br \/>\r<br>vector&lt;int&gt; v1(t, t+10); <br \/>\r<br>vector&lt;int&gt; v2(10); <br \/>\r<br>transform(v1.begin(), v1.end(), v2.begin(), bind1st(Add(), 1)); <br \/>\r<br>for_each(v2.rbegin(), v2.rend(), Out&lt;int&gt;(cout));cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_27' value='448224' \/><input type='hidden' id='answerType448224' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448224[]' id='answer-id-1734187' class='answer   answerof-448224 ' value='1734187'   \/><label for='answer-id-1734187' id='answer-label-1734187' class=' answer'><span>1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448224[]' id='answer-id-1734188' class='answer   answerof-448224 ' value='1734188'   \/><label for='answer-id-1734188' id='answer-label-1734188' class=' answer'><span>2 3 4 5 6 7 8 9 10 11<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448224[]' id='answer-id-1734189' class='answer   answerof-448224 ' value='1734189'   \/><label for='answer-id-1734189' id='answer-label-1734189' class=' answer'><span>10 9 8 7 6 5 4 3 2 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448224[]' id='answer-id-1734190' class='answer   answerof-448224 ' value='1734190'   \/><label for='answer-id-1734190' id='answer-label-1734190' class=' answer'><span>11 10 9 8 7 6 5 4 3 2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448224[]' id='answer-id-1734191' class='answer   answerof-448224 ' value='1734191'   \/><label for='answer-id-1734191' id='answer-label-1734191' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-28' style=';'><div id='questionWrap-28'  class='   watupro-question-id-448225'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>28. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;map&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>map&lt;int, int&gt; m; <br \/>\r<br>for(int i=0; i &lt; 10; i++) { <br \/>\r<br>m[i]=t[i]; <br \/>\r<br>} <br \/>\r<br>pair&lt;const int,int&gt; p(5,5); <br \/>\r<br>map&lt;int, int&gt;::iterator it = find(m.begin(), m.end(), p); <br \/>\r<br>if (it != m.end()) <br \/>\r<br>{ <br \/>\r<br>cout&lt;&lt;it?&gt;first&lt;&lt;endl; <br \/>\r<br>} <br \/>\r<br>else <br \/>\r<br>{ <br \/>\r<br>cout&lt;&lt;&quot;Not found!n&quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_28' value='448225' \/><input type='hidden' id='answerType448225' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448225[]' id='answer-id-1734192' class='answer   answerof-448225 ' value='1734192'   \/><label for='answer-id-1734192' id='answer-label-1734192' class=' answer'><span>5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448225[]' id='answer-id-1734193' class='answer   answerof-448225 ' value='1734193'   \/><label for='answer-id-1734193' id='answer-label-1734193' class=' answer'><span>Not found!<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448225[]' id='answer-id-1734194' class='answer   answerof-448225 ' value='1734194'   \/><label for='answer-id-1734194' id='answer-label-1734194' class=' answer'><span>10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448225[]' id='answer-id-1734195' class='answer   answerof-448225 ' value='1734195'   \/><label for='answer-id-1734195' id='answer-label-1734195' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-29' style=';'><div id='questionWrap-29'  class='   watupro-question-id-448226'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>29. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() <br \/>\r<br>{ <br \/>\r<br>cout.setf(ios::hex, ios::basefield); <br \/>\r<br>cout&lt;&lt;100&lt;&lt;&quot; &quot;; <br \/>\r<br>cout.flags(ios::showbase); <br \/>\r<br>cout&lt;&lt;100&lt;&lt;&quot; &quot;; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_29' value='448226' \/><input type='hidden' id='answerType448226' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448226[]' id='answer-id-1734196' class='answer   answerof-448226 ' value='1734196'   \/><label for='answer-id-1734196' id='answer-label-1734196' class=' answer'><span>64 64<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448226[]' id='answer-id-1734197' class='answer   answerof-448226 ' value='1734197'   \/><label for='answer-id-1734197' id='answer-label-1734197' class=' answer'><span>64 0x64<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448226[]' id='answer-id-1734198' class='answer   answerof-448226 ' value='1734198'   \/><label for='answer-id-1734198' id='answer-label-1734198' class=' answer'><span>0x64 0x64<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448226[]' id='answer-id-1734199' class='answer   answerof-448226 ' value='1734199'   \/><label for='answer-id-1734199' id='answer-label-1734199' class=' answer'><span>64 100<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448226[]' id='answer-id-1734200' class='answer   answerof-448226 ' value='1734200'   \/><label for='answer-id-1734200' id='answer-label-1734200' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-30' style=';'><div id='questionWrap-30'  class='   watupro-question-id-448227'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>30. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;set&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main(){ <br \/>\r<br>int t[] ={ 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 }; <br \/>\r<br>list&lt;int&gt;v(t, t+10); <br \/>\r<br>set&lt;int&gt; s1(v.begin(),v.end()); <br \/>\r<br>if (s1.count(3) == 2) { <br \/>\r<br>s1.erase(3); <br \/>\r<br>} <br \/>\r<br>for(set&lt;int&gt;::iterator i=s1.begin();i!= s1.end(); i++) { <br \/>\r<br>cout&lt;&lt;*i&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_30' value='448227' \/><input type='hidden' id='answerType448227' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448227[]' id='answer-id-1734201' class='answer   answerof-448227 ' value='1734201'   \/><label for='answer-id-1734201' id='answer-label-1734201' class=' answer'><span>program outputs: 1 2 3 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448227[]' id='answer-id-1734202' class='answer   answerof-448227 ' value='1734202'   \/><label for='answer-id-1734202' id='answer-label-1734202' class=' answer'><span>program outputs: 1 2 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448227[]' id='answer-id-1734203' class='answer   answerof-448227 ' value='1734203'   \/><label for='answer-id-1734203' id='answer-label-1734203' class=' answer'><span>program outputs: 1 1 2 2 3 4 4 5 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448227[]' id='answer-id-1734204' class='answer   answerof-448227 ' value='1734204'   \/><label for='answer-id-1734204' id='answer-label-1734204' class=' answer'><span>program outputs: 1 1 2 3 3 4 4 5 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448227[]' id='answer-id-1734205' class='answer   answerof-448227 ' value='1734205'   \/><label for='answer-id-1734205' id='answer-label-1734205' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-31' style=';'><div id='questionWrap-31'  class='   watupro-question-id-448228'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>31. <\/span>What happens when you attempt to compile and run the following code? Choose all that apply. <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;fstream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;iomanip&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class B { int val; <br \/>\r<br>public: <br \/>\r<br>B(int v=0):val(v){} <br \/>\r<br>int getV() const {return val;} <br \/>\r<br>operator int() const { return val; };}; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) {out&lt;&lt;setw(3)&lt;&lt;hex&lt;&lt;val; } }; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; <br \/>\r<br>fstream f(&quot;test.out&quot;, ios::trunc|ios::out); <br \/>\r<br>list&lt;B&gt; l(t, t+10); <br \/>\r<br>for_each(l.begin(), l.end(), Out&lt;B&gt;(f)); <br \/>\r<br>f.close(); <br \/>\r<br>f.open(&quot;test.out&quot;); <br \/>\r<br>for( ; f.good() ; ) { <br \/>\r<br>int i; <br \/>\r<br>f&gt;&gt;i; <br \/>\r<br>cout&lt;&lt;i&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>f.close(); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_31' value='448228' \/><input type='hidden' id='answerType448228' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448228[]' id='answer-id-1734206' class='answer   answerof-448228 ' value='1734206'   \/><label for='answer-id-1734206' id='answer-label-1734206' class=' answer'><span>file test.out will be opened writing<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448228[]' id='answer-id-1734207' class='answer   answerof-448228 ' value='1734207'   \/><label for='answer-id-1734207' id='answer-label-1734207' class=' answer'><span>file test.out will be truncated<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448228[]' id='answer-id-1734208' class='answer   answerof-448228 ' value='1734208'   \/><label for='answer-id-1734208' id='answer-label-1734208' class=' answer'><span>file test.out will be opened for reading<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448228[]' id='answer-id-1734209' class='answer   answerof-448228 ' value='1734209'   \/><label for='answer-id-1734209' id='answer-label-1734209' class=' answer'><span>no file will be created nor opened<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448228[]' id='answer-id-1734210' class='answer   answerof-448228 ' value='1734210'   \/><label for='answer-id-1734210' id='answer-label-1734210' class=' answer'><span>program will display sequence 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-32' style=';'><div id='questionWrap-32'  class='   watupro-question-id-448229'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>32. <\/span>What will happen when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;map&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;sstream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 3, 4, 2, 1, 0, 3, 4, 1, 2, 0 }; <br \/>\r<br>vector&lt;int&gt; v(t, t + 10); <br \/>\r<br>multimap&lt;int, string&gt; m; <br \/>\r<br>for (vector&lt;int&gt;::iterator i = v.begin(); i != v.end(); i++) { <br \/>\r<br>stringstream s;s &lt;&lt; *i &lt;&lt; *i; <br \/>\r<br>m.insert(pair&lt;int, string&gt;(*i, s.str())); <br \/>\r<br>} <br \/>\r<br>pair&lt;multimap&lt;int, string&gt;::iterator, multimap&lt;int, string&gt;::iterator&gt; range; <br \/>\r<br>range = m.equal_range(2); <br \/>\r<br>for (multimap&lt;int, string&gt;::iterator i = range.first; i != range.second; i++) { <br \/>\r<br>cout &lt;&lt; i?&gt;first &lt;&lt; &quot; &quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>The output will be:<\/div><input type='hidden' name='question_id[]' id='qID_32' value='448229' \/><input type='hidden' id='answerType448229' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448229[]' id='answer-id-1734211' class='answer   answerof-448229 ' value='1734211'   \/><label for='answer-id-1734211' id='answer-label-1734211' class=' answer'><span>2 2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448229[]' id='answer-id-1734212' class='answer   answerof-448229 ' value='1734212'   \/><label for='answer-id-1734212' id='answer-label-1734212' class=' answer'><span>1 2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448229[]' id='answer-id-1734213' class='answer   answerof-448229 ' value='1734213'   \/><label for='answer-id-1734213' id='answer-label-1734213' class=' answer'><span>1 3<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448229[]' id='answer-id-1734214' class='answer   answerof-448229 ' value='1734214'   \/><label for='answer-id-1734214' id='answer-label-1734214' class=' answer'><span>2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448229[]' id='answer-id-1734215' class='answer   answerof-448229 ' value='1734215'   \/><label for='answer-id-1734215' id='answer-label-1734215' class=' answer'><span>0 2<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-33' style=';'><div id='questionWrap-33'  class='   watupro-question-id-448230'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>33. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>int t[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; <br \/>\r<br>vector&lt;int&gt; v1(t, t + 10); <br \/>\r<br>deque&lt;int&gt; d1(v1.begin(), v1.end()); <br \/>\r<br>deque&lt;int&gt; d2; <br \/>\r<br>d2 = d1; <br \/>\r<br>d2.insert(d1.rbegin(), 10); <br \/>\r<br>for(int i = 0; i&lt;d1.size(); i++) <br \/>\r<br>{ <br \/>\r<br>cout&lt;&lt;d1[i]&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_33' value='448230' \/><input type='hidden' id='answerType448230' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448230[]' id='answer-id-1734216' class='answer   answerof-448230 ' value='1734216'   \/><label for='answer-id-1734216' id='answer-label-1734216' class=' answer'><span>program outputs: 0 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448230[]' id='answer-id-1734217' class='answer   answerof-448230 ' value='1734217'   \/><label for='answer-id-1734217' id='answer-label-1734217' class=' answer'><span>program outputs: 10 0 1 2 3 4 5 6 7 8 9<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448230[]' id='answer-id-1734218' class='answer   answerof-448230 ' value='1734218'   \/><label for='answer-id-1734218' id='answer-label-1734218' class=' answer'><span>program outputs: 0 1 2 3 4 5 6 7 8 9<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448230[]' id='answer-id-1734219' class='answer   answerof-448230 ' value='1734219'   \/><label for='answer-id-1734219' id='answer-label-1734219' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-34' style=';'><div id='questionWrap-34'  class='   watupro-question-id-448231'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>34. <\/span>Which changes introduced independently will allow the code to compile and display 0 0 1 1 8 8 9 9 <br \/>\r<br>(choose all that apply)? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;set&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>class A { <br \/>\r<br>int a; <br \/>\r<br>public: <br \/>\r<br>A(int a):a(a){} <br \/>\r<br>int getA() const { return a;} <br \/>\r<br>\/* Insert Code Here 1 *\/ <br \/>\r<br>}; <br \/>\r<br>\/* Insert Code Here 2*\/ <br \/>\r<br>int main(){ <br \/>\r<br>A t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 }; <br \/>\r<br>set&lt;A&gt;s(t, t+10);\/* Replace Code Here 3 *\/ <br \/>\r<br>multiset&lt;A&gt; s1(s.begin(),s.end());\/* Replace Code Here 4 *\/ <br \/>\r<br>s1.insert(s.begin(),s.end()); <br \/>\r<br>s1.erase(s1.lower_bound(2),s1.upper_bound(7)); <br \/>\r<br>multiset&lt;A&gt;::iterator i=s1.begin();\/* Replace Code Here 5 *\/ <br \/>\r<br>for( ;i!= s1.end(); i++) <br \/>\r<br>{ <br \/>\r<br>cout&lt;&lt;i?&gt;getA()&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>cout&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_34' value='448231' \/><input type='hidden' id='answerType448231' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448231[]' id='answer-id-1734220' class='answer   answerof-448231 ' value='1734220'   \/><label for='answer-id-1734220' id='answer-label-1734220' class=' answer'><span>operator int() const { return a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448231[]' id='answer-id-1734221' class='answer   answerof-448231 ' value='1734221'   \/><label for='answer-id-1734221' id='answer-label-1734221' class=' answer'><span>bool operator &lt; (const A &amp; b) const { return a&lt;b.a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448231[]' id='answer-id-1734222' class='answer   answerof-448231 ' value='1734222'   \/><label for='answer-id-1734222' id='answer-label-1734222' class=' answer'><span>bool operator &lt; (const A &amp; b) const { return b.a&lt;a;} inserted at Place 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448231[]' id='answer-id-1734223' class='answer   answerof-448231 ' value='1734223'   \/><label for='answer-id-1734223' id='answer-label-1734223' class=' answer'><span>struct R { bool operator ()(const A &amp; a, const A &amp; b) { return a.getA()&lt;b.getA();} }; inserted at \r\nPlace 2 \r\nreplacing line marked 3 with set&lt;A, R&gt;s(t, t+10); \r\nreplacing line marked 4 with multiset&lt;A,R&gt; s1(s.begin(),s.end()); \r\nreplacing line marked 5 with multiset&lt;A,R&gt;::iterator i=s1.begin();<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-35' style=';'><div id='questionWrap-35'  class='   watupro-question-id-448232'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>35. <\/span>What happens when you attempt to compile and run the following code? Choose all that apply. <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;fstream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;iomanip&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt;struct Out { <br \/>\r<br>ostream &amp; out; <br \/>\r<br>Out(ostream &amp; o): out(o){} <br \/>\r<br>void operator() (const T &amp; val ) {out&lt;&lt;setw(3)&lt;&lt;hex&lt;&lt;val; } }; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; <br \/>\r<br>fstream f(&quot;test.out&quot;, ios::trunc|ios::out); <br \/>\r<br>list&lt;int&gt; l(t, t+10); <br \/>\r<br>for_each(l.begin(), l.end(), Out&lt;int&gt;(f)); <br \/>\r<br>f.close(); f.open(&quot;test.out&quot;); <br \/>\r<br>for( ; f.good() ; ) { <br \/>\r<br>int i; f&gt;&gt;i; <br \/>\r<br>cout&lt;&lt;i&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>f.close(); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_35' value='448232' \/><input type='hidden' id='answerType448232' value='checkbox'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448232[]' id='answer-id-1734224' class='answer   answerof-448232 ' value='1734224'   \/><label for='answer-id-1734224' id='answer-label-1734224' class=' answer'><span>file test.out will be opened writing<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448232[]' id='answer-id-1734225' class='answer   answerof-448232 ' value='1734225'   \/><label for='answer-id-1734225' id='answer-label-1734225' class=' answer'><span>file test.out will be truncated<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448232[]' id='answer-id-1734226' class='answer   answerof-448232 ' value='1734226'   \/><label for='answer-id-1734226' id='answer-label-1734226' class=' answer'><span>file test.out will be opened for reading<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448232[]' id='answer-id-1734227' class='answer   answerof-448232 ' value='1734227'   \/><label for='answer-id-1734227' id='answer-label-1734227' class=' answer'><span>no file will be created nor opened<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='checkbox' name='answer-448232[]' id='answer-id-1734228' class='answer   answerof-448232 ' value='1734228'   \/><label for='answer-id-1734228' id='answer-label-1734228' class=' answer'><span>program will display sequence 1 2 3 4 5 6 7 8 9 10<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-36' style=';'><div id='questionWrap-36'  class='   watupro-question-id-448233'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>36. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;list&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>template&lt;class T&gt; <br \/>\r<br>void print(T start, T end) { <br \/>\r<br>while (start != end) { <br \/>\r<br>std::cout &lt;&lt; *start &lt;&lt; &quot; &quot;; start++; <br \/>\r<br>} <br \/>\r<br>} <br \/>\r<br>int main() <br \/>\r<br>{ <br \/>\r<br>int t1[] ={ 1, 7, 8, 4, 5 }; <br \/>\r<br>list&lt;int&gt; l1(t1, t1 + 5); <br \/>\r<br>int t2[] ={ 3, 2, 6, 9, 0 }; <br \/>\r<br>list&lt;int&gt; l2(t2, t2 + 5); <br \/>\r<br>l1.sort(); <br \/>\r<br>list&lt;int&gt;::iterator it = l2.begin(); <br \/>\r<br>it++; it++; <br \/>\r<br>l1.splice(l1.end(),l2, it, l2.end()); <br \/>\r<br>print(l1.begin(), l1.end()); cout&lt;&lt;&quot;Size:&quot;&lt;&lt;l1.size()&lt;&lt;&quot; &quot;; <br \/>\r<br>print(l2.begin(), l2.end()); cout&lt;&lt;&quot;Size:&quot;&lt;&lt;l2.size()&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_36' value='448233' \/><input type='hidden' id='answerType448233' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448233[]' id='answer-id-1734229' class='answer   answerof-448233 ' value='1734229'   \/><label for='answer-id-1734229' id='answer-label-1734229' class=' answer'><span>program outputs: 1 4 5 7 8 6 9 0 Size:8 3 2 Size:2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448233[]' id='answer-id-1734230' class='answer   answerof-448233 ' value='1734230'   \/><label for='answer-id-1734230' id='answer-label-1734230' class=' answer'><span>program outputs: 1 4 5 7 8 6 9 0 Size:8 3 2 6 9 0 Size:5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448233[]' id='answer-id-1734231' class='answer   answerof-448233 ' value='1734231'   \/><label for='answer-id-1734231' id='answer-label-1734231' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448233[]' id='answer-id-1734232' class='answer   answerof-448233 ' value='1734232'   \/><label for='answer-id-1734232' id='answer-label-1734232' class=' answer'><span>program outputs: 0 1 4 5 6 7 8 9 Size:8 3 2 Size:2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448233[]' id='answer-id-1734233' class='answer   answerof-448233 ' value='1734233'   \/><label for='answer-id-1734233' id='answer-label-1734233' class=' answer'><span>program outputs: 0 1 4 5 6 7 8 9 Size:8 3 2 6 9 0 Size:5<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-37' style=';'><div id='questionWrap-37'  class='   watupro-question-id-448234'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>37. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main () { <br \/>\r<br>int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5}; <br \/>\r<br>vector&lt;int&gt; v (t,t+15); <br \/>\r<br>int number = count(v.begin(), v.end(), 2); <br \/>\r<br>cout&lt;&lt; number&lt;&lt;endl; <br \/>\r<br>return 0; <br \/>\r<br>} <br \/>\r<br>Program outputs:<\/div><input type='hidden' name='question_id[]' id='qID_37' value='448234' \/><input type='hidden' id='answerType448234' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448234[]' id='answer-id-1734234' class='answer   answerof-448234 ' value='1734234'   \/><label for='answer-id-1734234' id='answer-label-1734234' class=' answer'><span>4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448234[]' id='answer-id-1734235' class='answer   answerof-448234 ' value='1734235'   \/><label for='answer-id-1734235' id='answer-label-1734235' class=' answer'><span>3<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448234[]' id='answer-id-1734236' class='answer   answerof-448234 ' value='1734236'   \/><label for='answer-id-1734236' id='answer-label-1734236' class=' answer'><span>2<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448234[]' id='answer-id-1734237' class='answer   answerof-448234 ' value='1734237'   \/><label for='answer-id-1734237' id='answer-label-1734237' class=' answer'><span>0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448234[]' id='answer-id-1734238' class='answer   answerof-448234 ' value='1734238'   \/><label for='answer-id-1734238' id='answer-label-1734238' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-38' style=';'><div id='questionWrap-38'  class='   watupro-question-id-448235'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>38. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>int main () <br \/>\r<br>{ <br \/>\r<br>int t[]={1,2,3,4,5}; <br \/>\r<br>std::vector&lt;int&gt;v1(t,t+5); <br \/>\r<br>std::vector&lt;int&gt;v2(v1); <br \/>\r<br>v1.resize(10); <br \/>\r<br>v2.reserve(10); <br \/>\r<br>std::vector&lt;int&gt;::iterator i = v1.begin();int ii = 0; <br \/>\r<br>while (i != v1.end()) { std::cout&lt;&lt;i[ii]&lt;&lt;&quot; &quot;;ii??;i++; } <br \/>\r<br>i = v2.begin();ii=0; <br \/>\r<br>while (i != v2.end()) { std::cout&lt;&lt;i[ii]&lt;&lt;&quot; &quot;;ii??;i++; } <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_38' value='448235' \/><input type='hidden' id='answerType448235' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448235[]' id='answer-id-1734239' class='answer   answerof-448235 ' value='1734239'   \/><label for='answer-id-1734239' id='answer-label-1734239' class=' answer'><span>program outputs 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448235[]' id='answer-id-1734240' class='answer   answerof-448235 ' value='1734240'   \/><label for='answer-id-1734240' id='answer-label-1734240' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448235[]' id='answer-id-1734241' class='answer   answerof-448235 ' value='1734241'   \/><label for='answer-id-1734241' id='answer-label-1734241' class=' answer'><span>program outputs 1 1 1 1 1 1 1 1 1 1 1 2 3 4 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448235[]' id='answer-id-1734242' class='answer   answerof-448235 ' value='1734242'   \/><label for='answer-id-1734242' id='answer-label-1734242' class=' answer'><span>program outputs 1 2 3 4 5 0 0 0 0 0 1 2 3 4 5 0 0 0 0 0<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-39' style=';'><div id='questionWrap-39'  class='   watupro-question-id-448236'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>39. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>include &lt;iostream&gt; <br \/>\r<br>#include &lt;algorithm&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;deque&gt; <br \/>\r<br>#include &lt;set&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main() { <br \/>\r<br>int t[] = { 10, 5, 9, 6, 2, 4, 7, 8, 3, 1 }; <br \/>\r<br>vector&lt;int&gt; v1(t, t + 10); <br \/>\r<br>deque&lt;int&gt; d1(t, t + 10); <br \/>\r<br>set&lt;int&gt; s1(t, t + 10); <br \/>\r<br>cout&lt;&lt;find(v1.begin(), v1.end(), 6)&lt;&lt;&quot; &quot;&lt;&lt;find(d1.begin(), d1.end(), 6)&lt;&lt;&quot; &quot;&lt;&lt;find(s1.begin(), <br \/>\r<br>s1.end(), 6); <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_39' value='448236' \/><input type='hidden' id='answerType448236' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448236[]' id='answer-id-1734243' class='answer   answerof-448236 ' value='1734243'   \/><label for='answer-id-1734243' id='answer-label-1734243' class=' answer'><span>program outputs: 6 6 6<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448236[]' id='answer-id-1734244' class='answer   answerof-448236 ' value='1734244'   \/><label for='answer-id-1734244' id='answer-label-1734244' class=' answer'><span>program outputs: 3 3 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448236[]' id='answer-id-1734245' class='answer   answerof-448236 ' value='1734245'   \/><label for='answer-id-1734245' id='answer-label-1734245' class=' answer'><span>program outputs: 3 6 5<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448236[]' id='answer-id-1734246' class='answer   answerof-448236 ' value='1734246'   \/><label for='answer-id-1734246' id='answer-label-1734246' class=' answer'><span>compilation error<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448236[]' id='answer-id-1734247' class='answer   answerof-448236 ' value='1734247'   \/><label for='answer-id-1734247' id='answer-label-1734247' class=' answer'><span>none of these<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div class='watu-question ' id='question-40' style=';'><div id='questionWrap-40'  class='   watupro-question-id-448237'>\n\t\t\t<div class='question-content'><div><span class='watupro_num'>40. <\/span>What happens when you attempt to compile and run the following code? <br \/>\r<br>#include &lt;iostream&gt; <br \/>\r<br>#include &lt;map&gt; <br \/>\r<br>#include &lt;vector&gt; <br \/>\r<br>#include &lt;sstream&gt; <br \/>\r<br>#include &lt;string&gt; <br \/>\r<br>using namespace std; <br \/>\r<br>int main(){ <br \/>\r<br>int t[] ={ 3, 4, 2, 1, 0, 1, 2, 3, 4, 0 }; <br \/>\r<br>vector&lt;int&gt; v(t, t+10); <br \/>\r<br>multimap&lt;int,string&gt; m; <br \/>\r<br>for(vector&lt;int&gt;::iterator i=v.begin(); i!=v.end(); i++) { <br \/>\r<br>stringstream s; s&lt;&lt;*i&lt;&lt;*i; m.insert(pair&lt;int,string&gt;(*i,s.str())); <br \/>\r<br>} <br \/>\r<br>for(multimap&lt;int, string&gt;::iterator i=m.begin();i!= m.end(); i++) { <br \/>\r<br>cout&lt;&lt;*i&lt;&lt;&quot; &quot;; <br \/>\r<br>} <br \/>\r<br>return 0; <br \/>\r<br>}<\/div><input type='hidden' name='question_id[]' id='qID_40' value='448237' \/><input type='hidden' id='answerType448237' value='radio'><!-- end question-content--><\/div><div class='question-choices watupro-choices-columns '><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448237[]' id='answer-id-1734248' class='answer   answerof-448237 ' value='1734248'   \/><label for='answer-id-1734248' id='answer-label-1734248' class=' answer'><span>program outputs: 3 4 2 1 0 1 2 3 4 0<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448237[]' id='answer-id-1734249' class='answer   answerof-448237 ' value='1734249'   \/><label for='answer-id-1734249' id='answer-label-1734249' class=' answer'><span>program outputs: 00 11 22 33 44<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448237[]' id='answer-id-1734250' class='answer   answerof-448237 ' value='1734250'   \/><label for='answer-id-1734250' id='answer-label-1734250' class=' answer'><span>program outputs: 0 0 1 1 2 2 3 3 4 4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448237[]' id='answer-id-1734251' class='answer   answerof-448237 ' value='1734251'   \/><label for='answer-id-1734251' id='answer-label-1734251' class=' answer'><span>program outputs: 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4<\/span><\/label><\/div><div class='watupro-question-choice  ' dir='auto' ><input type='radio' name='answer-448237[]' id='answer-id-1734252' class='answer   answerof-448237 ' value='1734252'   \/><label for='answer-id-1734252' id='answer-label-1734252' class=' answer'><span>compilation error<\/span><\/label><\/div><!-- end question-choices--><\/div><!-- end questionWrap--><\/div><\/div><div style='display:none' id='question-41'>\n\t<div class='question-content'>\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dumpsbase.com\/freedumps\/wp-content\/plugins\/watupro\/img\/loading.gif\" width=\"16\" height=\"16\" alt=\"Loading...\" title=\"Loading...\" \/>&nbsp;Loading...\t<\/div>\n<\/div>\n\n<br \/>\n\t\n\t\t\t<div class=\"watupro_buttons flex \" id=\"watuPROButtons11404\" >\n\t\t  <div id=\"prev-question\" style=\"display:none;\"><input type=\"button\" value=\"&lt; Previous\" onclick=\"WatuPRO.nextQuestion(event, 'previous');\"\/><\/div>\t\t  \t\t  \t\t   \n\t\t   \t  \t\t<div><input type=\"button\" name=\"action\" class=\"watupro-submit-button\" onclick=\"WatuPRO.submitResult(event)\" id=\"action-button\" value=\"View Results\"  \/>\n\t\t<\/div>\n\t\t<\/div>\n\t\t\n\t<input type=\"hidden\" name=\"quiz_id\" value=\"11404\" id=\"watuPROExamID\"\/>\n\t<input type=\"hidden\" name=\"start_time\" id=\"startTime\" value=\"2026-04-28 12:22:09\" \/>\n\t<input type=\"hidden\" name=\"start_timestamp\" id=\"startTimeStamp\" value=\"1777378929\" \/>\n\t<input type=\"hidden\" name=\"question_ids\" value=\"\" \/>\n\t<input type=\"hidden\" name=\"watupro_questions\" value=\"448198:1734066,1734067,1734068,1734069 | 448199:1734070,1734071,1734072,1734073 | 448200:1734074,1734075,1734076,1734077,1734078 | 448201:1734079,1734080,1734081,1734082,1734083 | 448202:1734084,1734085,1734086,1734087,1734088 | 448203:1734089,1734090,1734091,1734092,1734093 | 448204:1734094,1734095,1734096,1734097,1734098 | 448205:1734099,1734100,1734101,1734102 | 448206:1734103,1734104,1734105,1734106,1734107 | 448207:1734108,1734109,1734110,1734111,1734112 | 448208:1734113,1734114,1734115,1734116,1734117 | 448209:1734118,1734119,1734120,1734121 | 448210:1734122,1734123,1734124,1734125 | 448211:1734126,1734127,1734128,1734129,1734130 | 448212:1734131,1734132,1734133,1734134 | 448213:1734135,1734136,1734137,1734138,1734139 | 448214:1734140,1734141,1734142,1734143,1734144 | 448215:1734145,1734146,1734147,1734148 | 448216:1734149,1734150,1734151,1734152,1734153 | 448217:1734154,1734155,1734156,1734157,1734158 | 448218:1734159,1734160,1734161,1734162 | 448219:1734163,1734164,1734165,1734166 | 448220:1734167,1734168,1734169,1734170,1734171 | 448221:1734172,1734173,1734174,1734175,1734176 | 448222:1734177,1734178,1734179,1734180,1734181 | 448223:1734182,1734183,1734184,1734185,1734186 | 448224:1734187,1734188,1734189,1734190,1734191 | 448225:1734192,1734193,1734194,1734195 | 448226:1734196,1734197,1734198,1734199,1734200 | 448227:1734201,1734202,1734203,1734204,1734205 | 448228:1734206,1734207,1734208,1734209,1734210 | 448229:1734211,1734212,1734213,1734214,1734215 | 448230:1734216,1734217,1734218,1734219 | 448231:1734220,1734221,1734222,1734223 | 448232:1734224,1734225,1734226,1734227,1734228 | 448233:1734229,1734230,1734231,1734232,1734233 | 448234:1734234,1734235,1734236,1734237,1734238 | 448235:1734239,1734240,1734241,1734242 | 448236:1734243,1734244,1734245,1734246,1734247 | 448237:1734248,1734249,1734250,1734251,1734252\" \/>\n\t<input type=\"hidden\" name=\"no_ajax\" value=\"0\">\t\t\t<\/form>\n\t<p>&nbsp;<\/p>\n<\/div>\n\n<script type=\"text\/javascript\">\n\/\/jQuery(document).ready(function(){\ndocument.addEventListener(\"DOMContentLoaded\", function(event) { \t\nvar question_ids = \"448198,448199,448200,448201,448202,448203,448204,448205,448206,448207,448208,448209,448210,448211,448212,448213,448214,448215,448216,448217,448218,448219,448220,448221,448222,448223,448224,448225,448226,448227,448228,448229,448230,448231,448232,448233,448234,448235,448236,448237\";\nWatuPROSettings[11404] = {};\nWatuPRO.qArr = question_ids.split(',');\nWatuPRO.exam_id = 11404;\t    \nWatuPRO.post_id = 117308;\nWatuPRO.store_progress = 0;\nWatuPRO.curCatPage = 1;\nWatuPRO.requiredIDs=\"0\".split(\",\");\nWatuPRO.hAppID = \"0.45137400 1777378929\";\nvar url = \"https:\/\/www.dumpsbase.com\/freedumps\/wp-content\/plugins\/watupro\/show_exam.php\";\nWatuPRO.examMode = 1;\nWatuPRO.siteURL=\"https:\/\/www.dumpsbase.com\/freedumps\/wp-admin\/admin-ajax.php\";\nWatuPRO.emailIsNotRequired = 0;\nWatuPROIntel.init(11404);\nWatuPRO.inCategoryPages=1;});    \t \n<\/script>\n<p>&nbsp;<\/p>\n<h3>Choose to read the <a href=\"https:\/\/www.dumpsbase.com\/freedumps\/master-cpp-22-02-in-2026-with-the-latest-dumps-v8-02-free-c-certified-professional-programmer-cpp-22-02-free-dumps-part-2-q41-q85.html\"><span style=\"background-color: #ffcc99;\"><em>CPP-22-02 free dumps (Part 2, Q41-Q85) of V8.02<\/em><\/span><\/a> here.<\/h3>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Earning the CPP certification demonstrates your proficiency in STL containers, algorithms, iterators, functional programming tools, smart pointers, templates, advanced I\/O manipulation, and modern C++ language features. DumpsBase&#8217;s comprehensive CPP-22-02 dumps (V8.02) make passing the C++ Certified Professional Programmer exam easier. Our CPP-22-02 dumps (V8.02) include 228 practice questions and answers that cover all essential exam [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15960,435],"tags":[20781,20780],"class_list":["post-117308","post","type-post","status-publish","format-standard","hentry","category-c-certified-professional-programmer","category-c-institute","tag-cpp-c-certified-professional-programmer","tag-cpp-22-02"],"_links":{"self":[{"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/posts\/117308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/comments?post=117308"}],"version-history":[{"count":3,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/posts\/117308\/revisions"}],"predecessor-version":[{"id":117383,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/posts\/117308\/revisions\/117383"}],"wp:attachment":[{"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/media?parent=117308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/categories?post=117308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dumpsbase.com\/freedumps\/wp-json\/wp\/v2\/tags?post=117308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}