#include &lt;iostream&gt;    using namespace std;    class BaseClass     &#123;        public:        virtual void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;1&quot;;        &#125;    &#125;;    class DerivedClass1 : public BaseClass     &#123;        public:        void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;2&quot;;        &#125;    &#125;;   class DerivedClass2 : public DerivedClass1     &#123;        public:        void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;3&quot;;        &#125;    &#125;;    int main&#40;&#41;    &#123;        BaseClass *p;        BaseClass ob;        DerivedClass1 derivedObject1;        DerivedClass2 derivedObject2;        p = &amp;ob;        p -&gt; myFunction&#40;&#41;;        p = &amp;derivedObject1;        p -&gt; myFunction&#40;&#41;;        p = &amp;derivedObject2;        p -&gt; myFunction&#40;&#41;;        return 0;    &#125;
A. 123
B. 12
C. 213
D. 321
Answer:A
#include &lt;iostream&gt;    using namespace std;    class BaseClass     &#123;        public:        virtual void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;1&quot;;        &#125;    &#125;;    class DerivedClass1 : public BaseClass     &#123;        public:        void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;2&quot;;        &#125;    &#125;;   class DerivedClass2 : public DerivedClass1     &#123;        public:        void myFunction&#40;&#41;        &#123;            cout &lt;&lt; &quot;3&quot;;        &#125;    &#125;;    int main&#40;&#41;    &#123;        BaseClass *p;        BaseClass ob;        DerivedClass1 derivedObject1;        DerivedClass2 derivedObject2;        p = &amp;ob;        p -&gt; myFunction&#40;&#41;;        p = &amp;derivedObject1;        p -&gt; myFunction&#40;&#41;;        p = &amp;derivedObject2;        p -&gt; myFunction&#40;&#41;;        return 0;    &#125;
A. 123 B. 12 C. 213 D. 321
Explanation:We are passing the objects and executing them in a certain order and we are printing the program flow.