#include &lt;iostream&gt;    #include &lt;string&gt;    #include&lt;typeinfo&gt;    using namespace std;    int main&#40; &#41;    &#123;        try        &#123;            string strg1&#40;&quot;Test&quot;&#41;;            string strg2&#40;&quot;ing&quot;&#41;;            strg1.append&#40;strg2, 4, 2&#41;;            cout &lt;&lt; strg1 &lt;&lt; endl;        &#125;        catch &#40;exception &amp;e&#41;        &#123;            cout &lt;&lt; &quot;Caught: &quot; &lt;&lt; e.what&#40;&#41; &lt;&lt; endl;            cout &lt;&lt; &quot;Type: &quot; &lt;&lt; typeid&#40;e&#41;.name&#40;&#41; &lt;&lt; endl;        &#125;;        return 0;    &#125;
A. out of range
B. bad type_id
C. bad allocation
D. none of the mentioned
Answer:A
#include &lt;iostream&gt;    #include &lt;string&gt;    #include&lt;typeinfo&gt;    using namespace std;    int main&#40; &#41;    &#123;        try        &#123;            string strg1&#40;&quot;Test&quot;&#41;;            string strg2&#40;&quot;ing&quot;&#41;;            strg1.append&#40;strg2, 4, 2&#41;;            cout &lt;&lt; strg1 &lt;&lt; endl;        &#125;        catch &#40;exception &amp;e&#41;        &#123;            cout &lt;&lt; &quot;Caught: &quot; &lt;&lt; e.what&#40;&#41; &lt;&lt; endl;            cout &lt;&lt; &quot;Type: &quot; &lt;&lt; typeid&#40;e&#41;.name&#40;&#41; &lt;&lt; endl;        &#125;;        return 0;    &#125;
A. out of range B. bad type_id C. bad allocation D. none of the mentioned
Explanation:As we are using out of bound value on strings, So it arising an exception.