#include &lt;vector&gt;     #include &lt;algorithm&gt;    #include &lt;iostream&gt;    #include &lt;iterator&gt;    using namespace std;    int square&#40;int i&#41; &#123; return i * i; &#125;    int main&#40;&#41;    &#123;        vector&lt;int&gt; V, V2;        V.push_back&#40;0&#41;;        V.push_back&#40;1&#41;;        V.push_back&#40;2&#41;;        transform&#40;V.begin&#40;&#41;, V.end&#40;&#41;, back_inserter&#40;V2&#41;, square&#41;;        copy&#40;V2.begin&#40;&#41;, V2.end&#40;&#41;, ostream_iterator&lt;int&gt;&#40;cout, &quot; &quot;&#41;&#41;;        cout &lt;&lt; endl;    &#125;
A. 0
B. 1
C. 2
D. 0 1 4
Answer:A
#include &lt;vector&gt;     #include &lt;algorithm&gt;    #include &lt;iostream&gt;    #include &lt;iterator&gt;    using namespace std;    int square&#40;int i&#41; &#123; return i * i; &#125;    int main&#40;&#41;    &#123;        vector&lt;int&gt; V, V2;        V.push_back&#40;0&#41;;        V.push_back&#40;1&#41;;        V.push_back&#40;2&#41;;        transform&#40;V.begin&#40;&#41;, V.end&#40;&#41;, back_inserter&#40;V2&#41;, square&#41;;        copy&#40;V2.begin&#40;&#41;, V2.end&#40;&#41;, ostream_iterator&lt;int&gt;&#40;cout, &quot; &quot;&#41;&#41;;        cout &lt;&lt; endl;    &#125;
A. 0 B. 1 C. 2 D. 0 1 4
Explanation:In this program, We formed an algorithm to find the square of the given number.