#include &lt;iostream&gt;    #include &lt;vector&gt;    using namespace std;    int main &#40;&#41;    &#123;        vector&lt;int&gt; myvector;        int sum &#40;0&#41;;        myvector.push_back &#40;100&#41;;        myvector.push_back &#40;200&#41;;        myvector.push_back &#40;300&#41;;        while &#40;!myvector.empty&#40;&#41;&#41;        &#123;            sum += myvector.back&#40;&#41;;            myvector.pop_back&#40;&#41;;        &#125;        cout &lt;&lt; sum &lt;&lt; '\n';        return 0;    &#125;
A. 500
B. 600
C. 700
D. Error
Answer:A
#include &lt;iostream&gt;    #include &lt;vector&gt;    using namespace std;    int main &#40;&#41;    &#123;        vector&lt;int&gt; myvector;        int sum &#40;0&#41;;        myvector.push_back &#40;100&#41;;        myvector.push_back &#40;200&#41;;        myvector.push_back &#40;300&#41;;        while &#40;!myvector.empty&#40;&#41;&#41;        &#123;            sum += myvector.back&#40;&#41;;            myvector.pop_back&#40;&#41;;        &#125;        cout &lt;&lt; sum &lt;&lt; '\n';        return 0;    &#125;
A. 500 B. 600 C. 700 D. Error
Explanation:In this program, We are forming a stack and adding the elements and We are finding the total number of elements that are in stack.