Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming Quiz 7 – Which of the following statement is correct about the program given below?

Question: Which of the following statement is correct about the program given below?

#include
class IndiaBix
{
int x, y;
public:
IndiaBix(int xx = 0, int yy = 0)
{
x = xx;
y = yy;
}
void Display()
{
cout<< x << " " << y; } IndiaBix operator +(IndiaBix z) { IndiaBix objTemp; objTemp.x = x + z.x; objTemp.y = y + z.y; return objTemp; } }; int main() { IndiaBix objBix1(90, 80); IndiaBix objBix2(10, 20); IndiaBix objSum; IndiaBix &objRef = objSum; objRef = objBix1 + objBix2; objRef.Display(); return 0; }

[A].It will result in a runtime error.
[B].It will result in a compile time error.
[C].The program will print the output 9 4.
[D].The program will print the output 100 100. 

Answer: Option D