Home » C++ Programming » Constructors and Destructors

Which of the following statement is correct about the program given below? #include 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 .

← Previous Question Next Question→

More Questions from Constructors and Destructors

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion