1.

What is the output of this program?
#include <iostream>
using namespace std;
class Rectangle
{
int p, q;
public:
void value (int, int);
int area ()
{
return (p * q);
}
};
void Rectangle::value (int n, int m)
{
p = n;
q = m;
}
int main ()
{
Rectangle Rectangle;
Rectangle.value (6, 5);
cout << "Area of Rectangle : " << Rectangle.area();
return 0;
}

A. Area of Rectangle : 30
B. Area of Rectangle : 3
C. Area of Rectangle : 4
D. Compilation Error
E. None of these
Answer» B. Area of Rectangle : 3


Discussion

No Comment Found

Related MCQs