Question: 8. What will be the output of the following C++ code?<div class="hk1_style-wrap4"><div class="hk1_style-wrap3"><div class="hk1_style-wrap2"><div class="hk1_style-wrap"><div class="hk1_style"><div class="cpp"><ol><li class="li1"><pre class="de1"> <span class="co2">#include &lt;iostream&gt;</span></pre></li><li class="li1"><pre class="de1"> <span class="co2">#include &lt;algorithm&gt;</span></pre></li><li class="li1"><pre class="de1"> <span class="co2">#include &lt;vector&gt;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw2">using</span> <span class="kw2">namespace</span> std<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">int</span> main <span class="br0">(</span><span class="br0">)</span> </pre></li><li class="li1"><pre class="de1"> <span class="br0">{</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">int</span> first<span class="br0">[</span><span class="br0">]</span> <span class="sy1">=</span> <span class="br0">{</span><span class="nu0">5</span>, <span class="nu0">10</span>, <span class="nu0">15</span><span class="br0">}</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">int</span> second<span class="br0">[</span><span class="br0">]</span> <span class="sy1">=</span> <span class="br0">{</span><span class="nu0">50</span>, <span class="nu0">40</span>, <span class="nu0">30</span><span class="br0">}</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> vector<span class="sy1">&lt;</span><span class="kw4">int</span><span class="sy1">&gt;</span> v<span class="br0">(</span><span class="nu0">4</span><span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> vector<span class="sy1">&lt;</span><span class="kw4">int</span><span class="sy1">&gt;</span> <span class="sy4">::</span> <span class="me2">iterator</span> it<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> sort <span class="br0">(</span>first, first <span class="sy2">+</span> <span class="nu0">3</span><span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> sort <span class="br0">(</span>second, second <span class="sy2">+</span> <span class="nu0">3</span><span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> it <span class="sy1">=</span> set_symmetric_difference <span class="br0">(</span>first, first <span class="sy2">+</span> <span class="nu0">2</span>, second, second <span class="sy2">+</span> <span class="nu0">2</span>, </pre></li><li class="li1"><pre class="de1"> v.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> v.<span class="me1">resize</span><span class="br0">(</span>it <span class="sy2">-</span> v.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw1">for</span> <span class="br0">(</span>it <span class="sy1">=</span> v.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> it <span class="sy3">!</span><span class="sy1">=</span> v.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="sy2">++</span>it<span class="br0">)</span></pre></li><li class="li1"><pre class="de1"> <span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="st0">' '</span> <span class="sy1">&lt;&lt;</span> <span class="sy2">*</span>it<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw1">return</span> <span class="nu0">0</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="br0">}</span></pre></li></ol></div></div></div></div></div></div>
Options:
5 10
30 40
50 40
5 10 30 40
Answer: D