Which of the following statement is correct about the program given below? #include<iostream.h>
class CuriousTab
{
int x;
public:
CuriousTab()
{
x = 0;
}
CuriousTab(int xx)
{
x = xx;
}
CuriousTab(CuriousTab &objB)
{
x = objB.x;
}
void Display()
{
cout<< x << " ";
}
};
int main()
{
CuriousTab objA(25);
CuriousTab objB(objA);
CuriousTab objC = objA;
objA.Display();
objB.Display();
objC.Display();
return 0;
}
Correct Answer: The program will print the output 25 25 25 .
Discussion & Comments