#include &lt;iostream&gt;    using namespace std;    class rect    &#123;        int x, y;        public:        void val &#40;int, int&#41;;        int area &#40;&#41;        &#123;            return &#40;x * y&#41;;        &#125;    &#125;;    void rect::val &#40;int a, int b&#41;    &#123;        x = a;        y = b;    &#125;    int main &#40;&#41;    &#123;        rect rect;        rect.val &#40;3, 4&#41;;        cout &lt;&lt; &quot;rect area: &quot; &lt;&lt; rect.area&#40;&#41;;        return 0;    &#125;
A. rect area:12
B. rect area: 12
C. rect area:24
D. none of the mentioned
Answer:A
#include &lt;iostream&gt;    using namespace std;    class rect    &#123;        int x, y;        public:        void val &#40;int, int&#41;;        int area &#40;&#41;        &#123;            return &#40;x * y&#41;;        &#125;    &#125;;    void rect::val &#40;int a, int b&#41;    &#123;        x = a;        y = b;    &#125;    int main &#40;&#41;    &#123;        rect rect;        rect.val &#40;3, 4&#41;;        cout &lt;&lt; &quot;rect area: &quot; &lt;&lt; rect.area&#40;&#41;;        return 0;    &#125;
A. rect area:12 B. rect area: 12 C. rect area:24 D. none of the mentioned
Explanation:In this program, we are calculating the area of rectangle based on given values.