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"><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="kw2">using</span> <span class="kw2">namespace</span> std<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">double</span> division<span class="br0">(</span><span class="kw4">int</span> a, <span class="kw4">int</span> b<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="kw1">if</span> <span class="br0">(</span> b <span class="sy1">==</span> <span class="nu0">0</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="kw1">throw</span> <span class="st0">"Division by zero condition!"</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="br0">}</span></pre></li><li class="li1"><pre class="de1"> <span class="kw1">return</span> <span class="br0">(</span>a <span class="sy2">/</span> b<span class="br0">)</span><span class="sy4">;</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> 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> x <span class="sy1">=</span> <span class="nu0">50</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">int</span> y <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw4">double</span> z <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw2">try</span> </pre></li><li class="li1"><pre class="de1"> <span class="br0">{</span></pre></li><li class="li1"><pre class="de1"> z <span class="sy1">=</span> division<span class="br0">(</span>x, y<span class="br0">)</span><span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> z <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="br0">}</span></pre></li><li class="li1"><pre class="de1"> <span class="kw2">catch</span> <span class="br0">(</span><span class="kw4">const</span> <span class="kw4">char</span><span class="sy2">*</span> msg<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="kw3">cout</span> <span class="sy1">&lt;&lt;</span> msg <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span></pre></li><li class="li1"><pre class="de1"> <span class="br0">}</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:
50
0
Division by zero condition!
100
Answer: C