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