#include &lt;iostream&gt;    using namespace std;    class p     &#123;        protected:        int width, height;        public:        void set_values &#40;int a, int b&#41;        &#123;            width = a; height = b;         &#125;        virtual int area &#40;void&#41; = 0;    &#125;;    class r: public p    &#123;        public:        int area &#40;void&#41;        &#123;             return &#40;width * height&#41;;        &#125;    &#125;;    class t: public p     &#123;        public:        int area &#40;void&#41;        &#123;            return &#40;width * height / 2&#41;;         &#125;    &#125;;    int main &#40;&#41;     &#123;        r rect;        t trgl;        p * ppoly1 = &amp;rect;        p * ppoly2 = &amp;trgl;        ppoly1-&gt;set_values &#40;4, 5&#41;;        ppoly2-&gt;set_values &#40;4, 5&#41;;        cout &lt;&lt; ppoly1 -&gt; area&#40;&#41; ;        cout &lt;&lt; ppoly2 -&gt; area&#40;&#41;;        return 0;    &#125;
A. 1020
B. 20
C. 10
D. 2010
Answer:A
#include &lt;iostream&gt;    using namespace std;    class p     &#123;        protected:        int width, height;        public:        void set_values &#40;int a, int b&#41;        &#123;            width = a; height = b;         &#125;        virtual int area &#40;void&#41; = 0;    &#125;;    class r: public p    &#123;        public:        int area &#40;void&#41;        &#123;             return &#40;width * height&#41;;        &#125;    &#125;;    class t: public p     &#123;        public:        int area &#40;void&#41;        &#123;            return &#40;width * height / 2&#41;;         &#125;    &#125;;    int main &#40;&#41;     &#123;        r rect;        t trgl;        p * ppoly1 = &amp;rect;        p * ppoly2 = &amp;trgl;        ppoly1-&gt;set_values &#40;4, 5&#41;;        ppoly2-&gt;set_values &#40;4, 5&#41;;        cout &lt;&lt; ppoly1 -&gt; area&#40;&#41; ;        cout &lt;&lt; ppoly2 -&gt; area&#40;&#41;;        return 0;    &#125;
A. 1020 B. 20 C. 10 D. 2010