#include &lt;iostream&gt;    using namespace std;    void PrintSequence&#40;int StopNum&#41;    &#123;        int Num;        Num = 1;        while &#40;true&#41; &#123;            if &#40;Num &gt;= StopNum&#41;                throw Num;            cout &lt;&lt; Num;            Num++;        &#125;    &#125;    int main&#40;void&#41;    &#123;        try &#123;            PrintSequence&#40;20&#41;;        &#125;        catch&#40;int ExNum&#41;        &#123;            cout &lt;&lt; &quot;Caught an exception with value: &quot; &lt;&lt; ExNum;        &#125;        return 0;    &#125;
A. compile time error
B. prints first 19 numbers
C. prints first 19 numbers and throws exception at 20
D. none of the mentioned
Answer:A
#include &lt;iostream&gt;    using namespace std;    void PrintSequence&#40;int StopNum&#41;    &#123;        int Num;        Num = 1;        while &#40;true&#41; &#123;            if &#40;Num &gt;= StopNum&#41;                throw Num;            cout &lt;&lt; Num;            Num++;        &#125;    &#125;    int main&#40;void&#41;    &#123;        try &#123;            PrintSequence&#40;20&#41;;        &#125;        catch&#40;int ExNum&#41;        &#123;            cout &lt;&lt; &quot;Caught an exception with value: &quot; &lt;&lt; ExNum;        &#125;        return 0;    &#125;
A. compile time error B. prints first 19 numbers C. prints first 19 numbers and throws exception at 20 D. none of the mentioned
Explanation:In this program, we are printing upto 19 numbers and when executing the 20, we are raising a exception.