#include &lt;iostream&gt;    using namespace std;    class sample     &#123;        int width, height;        public:        void set_values &#40;int, int&#41;;        int area &#40;&#41; &#123;return &#40;width * height&#41;;&#125;        friend sample duplicate &#40;sample&#41;;    &#125;;    void sample::set_values &#40;int a, int b&#41;     &#123;        width = a;        height = b;    &#125;    sample duplicate &#40;sample rectparam&#41;    &#123;        sample rectres;        rectres.width = rectparam.width * 2;        rectres.height = rectparam.height * 2;        return &#40;rectres&#41;;    &#125;      int main &#40;&#41;      &#123;        sample rect, rectb;        rect.set_values &#40;2, 3&#41;;        rectb = duplicate &#40;rect&#41;;        cout &lt;&lt; rectb.area&#40;&#41;;        return 0;    &#125;
A. 20
B. 16
C. 24
D. None of the mentioned
Answer:A
#include &lt;iostream&gt;    using namespace std;    class sample     &#123;        int width, height;        public:        void set_values &#40;int, int&#41;;        int area &#40;&#41; &#123;return &#40;width * height&#41;;&#125;        friend sample duplicate &#40;sample&#41;;    &#125;;    void sample::set_values &#40;int a, int b&#41;     &#123;        width = a;        height = b;    &#125;    sample duplicate &#40;sample rectparam&#41;    &#123;        sample rectres;        rectres.width = rectparam.width * 2;        rectres.height = rectparam.height * 2;        return &#40;rectres&#41;;    &#125;      int main &#40;&#41;      &#123;        sample rect, rectb;        rect.set_values &#40;2, 3&#41;;        rectb = duplicate &#40;rect&#41;;        cout &lt;&lt; rectb.area&#40;&#41;;        return 0;    &#125;
A. 20 B. 16 C. 24 D. None of the mentioned
Explanation:In this program, we are using the friend function for duplicate function and calculating the area of the rectangle.