1.

What is the output of this program?
#include <iostream>
using namespace std;
class Example
{
private:
int p, q;
public:
void test()
{
p = 150;
q = 250;
}
friend int Calculate(Example Exmp1);
};
int Calculate(Example Exmp1)
{
return int(Exmp1.p + Exmp1.q) - 5;
}
int main()
{
Example obj;
obj.test();
cout << Calculate(obj);
return 0;
}

A. 250
B. 295
C. 150
D. 395
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs