When I run it on Windows with code::blocks (MinGW), the opening of console is succeeded by an error message "xyz.exe has stopped working" where xyz.cpp is the source. Yet, it works fine on Turbo C++ 3 on Windows (with some modifications of course like including conio.h and getch() as shown above). On Linux (With codeblocks and g++ 11), the console starts giving no output. What's wrong with the code? Why is it working only on Turbo C++? What the issue when I am using it in codeblocks?