Question: 6. 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"><pre class="de1"><span class="co2">#include &lt;iostream&gt;</span> <span class="co2">#include &lt;string&gt;</span> <span class="kw2">using</span> <span class="kw2">namespace</span> std<span class="sy4">;</span> <span class="kw2">class</span> complex <span class="br0">{</span> <span class="kw4">int</span> i<span class="sy4">;</span> <span class="kw4">int</span> j<span class="sy4">;</span> <span class="kw2">public</span><span class="sy4">:</span> complex<span class="br0">(</span><span class="br0">)</span><span class="br0">{</span><span class="br0">}</span> complex<span class="br0">(</span><span class="kw4">int</span> a, <span class="kw4">int</span> b<span class="br0">)</span> <span class="br0">{</span> i <span class="sy1">=</span> a<span class="sy4">;</span> j <span class="sy1">=</span> b<span class="sy4">;</span> <span class="br0">}</span> &nbsp; complex operator<span class="sy2">+</span><span class="br0">(</span>complex c<span class="br0">)</span> <span class="br0">{</span> complex temp<span class="sy4">;</span> temp.<span class="me1">i</span> <span class="sy1">=</span> this<span class="sy2">-</span><span class="sy1">&gt;</span>i <span class="sy2">+</span> c.<span class="me1">i</span><span class="sy4">;</span> temp.<span class="me1">j</span> <span class="sy1">=</span> this<span class="sy2">-</span><span class="sy1">&gt;</span>j <span class="sy2">+</span> c.<span class="me1">j</span><span class="sy4">;</span> <span class="kw1">return</span> temp<span class="sy4">;</span> <span class="br0">}</span> &nbsp; <span class="kw4">void</span> show<span class="br0">(</span><span class="br0">)</span><span class="br0">{</span> <span class="kw3">cout</span><span class="sy1">&lt;&lt;</span><span class="st0">"Complex Number: "</span><span class="sy1">&lt;&lt;</span>i<span class="sy1">&lt;&lt;</span><span class="st0">" + i"</span><span class="sy1">&lt;&lt;</span>j<span class="sy1">&lt;&lt;</span>endl<span class="sy4">;</span> <span class="br0">}</span> <span class="br0">}</span><span class="sy4">;</span> &nbsp; <span class="kw4">int</span> main<span class="br0">(</span><span class="kw4">int</span> argc, <span class="kw4">char</span> <span class="kw4">const</span> <span class="sy2">*</span>argv<span class="br0">[</span><span class="br0">]</span><span class="br0">)</span> <span class="br0">{</span> complex c1<span class="br0">(</span><span class="nu0">1</span>,<span class="nu0">2</span><span class="br0">)</span><span class="sy4">;</span> complex c2<span class="br0">(</span><span class="nu0">3</span>,<span class="nu0">4</span><span class="br0">)</span><span class="sy4">;</span> complex c3 <span class="sy1">=</span> c1 <span class="sy2">+</span> c2<span class="sy4">;</span> c3.<span class="me1">show</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="kw1">return</span> <span class="nu0">0</span><span class="sy4">;</span> <span class="br0">}</span></pre></div></div></div></div></div></div>
Options:
Complex Number: 4 + i6
Complex Number: 2 + i2
Error
Segmentation fault
Answer: A