Question: Which of the following statement is correct about the program given below?
#include
class IndiaBix
{
int x;
public:
IndiaBix()
{
x = 0;
}
IndiaBix(int xx)
{
x = xx;
}
IndiaBix(IndiaBix &objB)
{
x = objB.x;
}
void Display()
{
cout<< x << " ";
}
};
int main()
{
IndiaBix objA(25);
IndiaBix objB(objA);
IndiaBix objC = objA;
objA.Display();
objB.Display();
objC.Display();
return 0;
}
[A].The program will print the output 25 25 25 .
[B].The program will print the output 25 Garbage 25 .
[C].The program will print the output Garbage 25 25 .
[D].The program will report compile time error.
Answer: Option A