#include &lt;iostream&gt;    using namespace std;    class sample    &#123;        private:        int a, b;        public:        void test&#40;&#41;        &#123;            a = 100;            b = 200;        &#125;        friend int compute&#40;sample e1&#41;;    &#125;;    int compute&#40;sample e1&#41;    &#123;        return int&#40;e1.a + e1.b&#41; - 5;    &#125;    int main&#40;&#41;    &#123;        sample e;        e.test&#40;&#41;;        cout  &lt;&lt; compute&#40;e&#41;;        return 0;    &#125;
A. 100
B. 200
C. 300
D. 295
Answer:A
#include &lt;iostream&gt;    using namespace std;    class sample    &#123;        private:        int a, b;        public:        void test&#40;&#41;        &#123;            a = 100;            b = 200;        &#125;        friend int compute&#40;sample e1&#41;;    &#125;;    int compute&#40;sample e1&#41;    &#123;        return int&#40;e1.a + e1.b&#41; - 5;    &#125;    int main&#40;&#41;    &#123;        sample e;        e.test&#40;&#41;;        cout  &lt;&lt; compute&#40;e&#41;;        return 0;    &#125;
A. 100 B. 200 C. 300 D. 295
Explanation:In this program, we are finding a value from the given function by using the friend for compute function.