#include &lt;iostream&gt;     using namespace std;    class A    &#123;        public:        int x;        A&#40;int n = 0&#41; : x&#40;n&#41; &#123;&#125;;        int&amp; operator&#91;&#93;&#40;int n&#41;        &#123;             cout &lt;&lt; &quot;0&quot; ;             return x;        &#125;        int operator&#91;&#93;&#40;int n&#41; const        &#123;             cout &lt;&lt; &quot;1&quot; ;             return x;        &#125;     &#125;;    void foo&#40;const A&amp; a&#41;    &#123;        int z = a&#91;2&#93;;    &#125;    int main&#40;&#41;    &#123;        A a&#40;7&#41;;        a&#91;3&#93;  = 8;        int z = a&#91;2&#93;;        foo&#40;a&#41;;        return 0;    &#125;
A. 110
B. 111
C. 011
D. 001
Answer:A
#include &lt;iostream&gt;     using namespace std;    class A    &#123;        public:        int x;        A&#40;int n = 0&#41; : x&#40;n&#41; &#123;&#125;;        int&amp; operator&#91;&#93;&#40;int n&#41;        &#123;             cout &lt;&lt; &quot;0&quot; ;             return x;        &#125;        int operator&#91;&#93;&#40;int n&#41; const        &#123;             cout &lt;&lt; &quot;1&quot; ;             return x;        &#125;     &#125;;    void foo&#40;const A&amp; a&#41;    &#123;        int z = a&#91;2&#93;;    &#125;    int main&#40;&#41;    &#123;        A a&#40;7&#41;;        a&#91;3&#93;  = 8;        int z = a&#91;2&#93;;        foo&#40;a&#41;;        return 0;    &#125;
A. 110 B. 111 C. 011 D. 001
Explanation:In this program, we overloading the operator[] by using subscript operator.