#include &lt;iostream&gt;    #include &lt;exception&gt;    using namespace std;    class base &#123; virtual void dummy&#40;&#41; &#123;&#125; &#125;;    class derived: public base &#123; int a; &#125;;    int main &#40;&#41;     &#123;        try         &#123;            base * pba = new derived;            base * pbb = new base;            derived * pd;            pd = dynamic_cast&lt;derived*&gt;&#40;pba&#41;;            if &#40;pd == 0&#41;                 cout &lt;&lt; &quot;Null pointer on first type-cast&quot; &lt;&lt; endl;            pd = dynamic_cast&lt;derived*&gt;&#40;pbb&#41;;            if &#40;pd == 0&#41;                 cout &lt;&lt; &quot;Null pointer on second type-cast&quot; &lt;&lt; endl;        &#125;         catch &#40;exception&amp; e&#41;         &#123;            cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; e.what&#40;&#41;;        &#125;        return 0;    &#125;
A. Null pointer on first type-cast
B. Null pointer on second type-cast
C. Exception
D. None of the mentioned
Answer:A
#include &lt;iostream&gt;    #include &lt;exception&gt;    using namespace std;    class base &#123; virtual void dummy&#40;&#41; &#123;&#125; &#125;;    class derived: public base &#123; int a; &#125;;    int main &#40;&#41;     &#123;        try         &#123;            base * pba = new derived;            base * pbb = new base;            derived * pd;            pd = dynamic_cast&lt;derived*&gt;&#40;pba&#41;;            if &#40;pd == 0&#41;                 cout &lt;&lt; &quot;Null pointer on first type-cast&quot; &lt;&lt; endl;            pd = dynamic_cast&lt;derived*&gt;&#40;pbb&#41;;            if &#40;pd == 0&#41;                 cout &lt;&lt; &quot;Null pointer on second type-cast&quot; &lt;&lt; endl;        &#125;         catch &#40;exception&amp; e&#41;         &#123;            cout &lt;&lt; &quot;Exception: &quot; &lt;&lt; e.what&#40;&#41;;        &#125;        return 0;    &#125;
A. Null pointer on first type-cast B. Null pointer on second type-cast C. Exception D. None of the mentioned
Explanation:In this program, We apply the dynamic cast to pd. Based on the value in the pd, it produces the output.