#include &lt;iostream&gt;    #include &lt;stdarg.h&gt;    using namespace std;    int add &#40;int num, ...&#41;    &#123;        int sum = 0;        va_list args;        va_start &#40;args,num&#41;;        for &#40;int i = 0; i &lt; num; i++&#41; &#123;            int num = va_arg &#40;args,int&#41;;            sum += num;        &#125;        va_end &#40;args&#41;;        return sum;    &#125;    int main &#40;void&#41;    &#123;        int total = add&#40;8, 1, 2, -1, 4, 12, -2, 9, 7&#41;;        cout &lt;&lt; &quot;The result is &quot; &lt;&lt; total;        return 0;    &#125;
A. 32
B. 23
C. 48
D. compile time error
Answer:A
#include &lt;iostream&gt;    #include &lt;stdarg.h&gt;    using namespace std;    int add &#40;int num, ...&#41;    &#123;        int sum = 0;        va_list args;        va_start &#40;args,num&#41;;        for &#40;int i = 0; i &lt; num; i++&#41; &#123;            int num = va_arg &#40;args,int&#41;;            sum += num;        &#125;        va_end &#40;args&#41;;        return sum;    &#125;    int main &#40;void&#41;    &#123;        int total = add&#40;8, 1, 2, -1, 4, 12, -2, 9, 7&#41;;        cout &lt;&lt; &quot;The result is &quot; &lt;&lt; total;        return 0;    &#125;
A. 32 B. 23 C. 48 D. compile time error
Explanation:We are adding these numbers by using for statement and stdarg.