Home » C++ Programming » Objects and Classes

Which of the following statement is correct about the program given below? #include #include class CuriousTab { static int x; public: CuriousTab() { if(x == 1) exit(0); else x++; } void Display() { cout<< x << " "; } }; int CuriousTab::x = 0; int main() { CuriousTab objCuriousTab1; objCuriousTab1.Display(); CuriousTab objCuriousTab2; objCuriousTab2.Display(); return 0; }

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!