#include &lt;iostream&gt;    using namespace std;    struct X;    struct Y     &#123;        void f&#40;X*&#41;;    &#125;;    struct X     &#123;        private:        int i;        public:        void initialize&#40;&#41;;         friend void g&#40;X* , int&#41;;        friend void Y :: f&#40;X*&#41;;        friend struct Z;        friend void h&#40;&#41;;    &#125;;    void X :: initialize&#40;&#41;     &#123;        i = 0;    &#125;    void g&#40;X* x, int i&#41;     &#123;        x -&gt; i = i;    &#125;    void Y :: f&#40;X * x&#41;     &#123;        x -&gt; i = 47;        cout &lt;&lt; x-&gt;i;    &#125;    struct Z     &#123;        private:        int j;        public:        void initialize&#40;&#41;;        void g&#40;X* x&#41;;    &#125;;    void Z::initialize&#40;&#41;     &#123;        j = 99;    &#125;    void Z::g&#40;X* x&#41;     &#123;        x -&gt; i += j;    &#125;    void h&#40;&#41;     &#123;        X x;        x.i = 100;        cout &lt;&lt; x.i;    &#125;    int main&#40;&#41;     &#123;        X x;        Z z;        z.g&#40;&amp;x&#41;;        cout &lt;&lt; &quot;Data accessed&quot;;    &#125;
A. 99
B. 47
C. Data accessed
D. None of the mentioned
Answer:A
#include &lt;iostream&gt;    using namespace std;    struct X;    struct Y     &#123;        void f&#40;X*&#41;;    &#125;;    struct X     &#123;        private:        int i;        public:        void initialize&#40;&#41;;         friend void g&#40;X* , int&#41;;        friend void Y :: f&#40;X*&#41;;        friend struct Z;        friend void h&#40;&#41;;    &#125;;    void X :: initialize&#40;&#41;     &#123;        i = 0;    &#125;    void g&#40;X* x, int i&#41;     &#123;        x -&gt; i = i;    &#125;    void Y :: f&#40;X * x&#41;     &#123;        x -&gt; i = 47;        cout &lt;&lt; x-&gt;i;    &#125;    struct Z     &#123;        private:        int j;        public:        void initialize&#40;&#41;;        void g&#40;X* x&#41;;    &#125;;    void Z::initialize&#40;&#41;     &#123;        j = 99;    &#125;    void Z::g&#40;X* x&#41;     &#123;        x -&gt; i += j;    &#125;    void h&#40;&#41;     &#123;        X x;        x.i = 100;        cout &lt;&lt; x.i;    &#125;    int main&#40;&#41;     &#123;        X x;        Z z;        z.g&#40;&amp;x&#41;;        cout &lt;&lt; &quot;Data accessed&quot;;    &#125;
A. 99 B. 47 C. Data accessed D. None of the mentioned
Explanation:In this program, We are using the access specifiers to friend function to manipulate the values.