1.

What is the output of this program?
#include <iostream>
using namespace std;
class Example
{
int value1, value2, value3;
public:
int get()
{
value1 = 100;
value2 = 350;
value3 = 450;
}
friend float Average(Example obj);
};
float Average(Example obj)
{
return float(obj.value1 + obj.value2 + obj.value3) / 3;
}
int main()
{
Example object;
object.get();
cout << Average(object);
return 0;
}

A. 100
B. 200
C. 300
D. Compilation Error
E. None of these
Answer» D. Compilation Error


Discussion

No Comment Found

Related MCQs