#include &lt;iostream&gt;    using namespace std;    class student    &#123;        public:        int rno , m1 , m2 ;        protected:        void get&#40;&#41;        &#123;            rno = 15, m1 = 10, m2 = 10;        &#125;    &#125;;    class sports    &#123;        public:        int sm;        void getsm&#40;&#41;        &#123;            sm = 10;        &#125;    &#125;;    class statement : public student, public sports    &#123;        int tot, avg;        public:        void display&#40;&#41;        &#123;            tot = &#40;m1 + m2 + sm&#41;;            avg = tot / 3;            cout &lt;&lt; tot;            cout &lt;&lt; avg;        &#125;        void setObject&#40;&#41;        &#123;            get&#40;&#41;;        &#125;    &#125;;    int main&#40;&#41;    &#123;        statement obj;        obj.setObject&#40;&#41;;        obj.getsm&#40;&#41;;        obj.display&#40;&#41;;    &#125;
A. 3010
B. 1010
C. 2100
D. Error
Answer:A
#include &lt;iostream&gt;    using namespace std;    class student    &#123;        public:        int rno , m1 , m2 ;        protected:        void get&#40;&#41;        &#123;            rno = 15, m1 = 10, m2 = 10;        &#125;    &#125;;    class sports    &#123;        public:        int sm;        void getsm&#40;&#41;        &#123;            sm = 10;        &#125;    &#125;;    class statement : public student, public sports    &#123;        int tot, avg;        public:        void display&#40;&#41;        &#123;            tot = &#40;m1 + m2 + sm&#41;;            avg = tot / 3;            cout &lt;&lt; tot;            cout &lt;&lt; avg;        &#125;        void setObject&#40;&#41;        &#123;            get&#40;&#41;;        &#125;    &#125;;    int main&#40;&#41;    &#123;        statement obj;        obj.setObject&#40;&#41;;        obj.getsm&#40;&#41;;        obj.display&#40;&#41;;    &#125;
A. 3010 B. 1010 C. 2100 D. Error
Explanation: None.