#include &lt;iostream&gt;    using namespace std;     int main&#40;&#41;    &#123;        int x = -1;        char *ptr;        ptr = new char&#91;256&#93;;        try         &#123;            if &#40;x &lt; 0&#41;            &#123;                throw x;            &#125;            if &#40;ptr == NULL&#41;            &#123;                throw &quot; ptr is NULL &quot;;            &#125;        &#125;        catch &#40;...&#41;         &#123;            cout &lt;&lt; &quot;Exception occurred: exiting &quot;&lt;&lt; endl;        &#125;        return 0;    &#125;
A. -1
B. ptr is NULL
C. Exception occured: exiting
D. none of the mentioned
Answer:A
#include &lt;iostream&gt;    using namespace std;     int main&#40;&#41;    &#123;        int x = -1;        char *ptr;        ptr = new char&#91;256&#93;;        try         &#123;            if &#40;x &lt; 0&#41;            &#123;                throw x;            &#125;            if &#40;ptr == NULL&#41;            &#123;                throw &quot; ptr is NULL &quot;;            &#125;        &#125;        catch &#40;...&#41;         &#123;            cout &lt;&lt; &quot;Exception occurred: exiting &quot;&lt;&lt; endl;        &#125;        return 0;    &#125;
A. -1 B. ptr is NULL C. Exception occured: exiting D. none of the mentioned
Explanation:catch(…) is used to catch all types of exceptions arising in the program.