// Game.cpp (c) Kari Laitinen // http://www.naturalprogramming.com/ // 1997-??-?? File created. // 2023-01-05 The following comment was added. /* Compiling C++ programs these days seems to be easy with the tools that come when you install the free Microsoft Visual Studio (Community Edition.) You must specify C++ before you do the installation. After the installation, you have among your installed programs an app named x64 Native Tools Command Prompt for VS 2022. When you open this, a Command Prompt window opens, and you can compile and execute C++ programs. This program could be compiled and executed with the following commands when the file was located in folder E:\programs\cppfiles2 E: cd programs cd cppfiles2 cl Game.cpp /EHsc Game The last command executed the Game.exe file. I had to use the parameter /EHsc in compilation in order to suppress some warnings. Also the C version of this program Game.c could be compiled with the cl command, even without the extra parameter. */ #include using namespace std ; int main() { int integer_from_keyboard ; int one_larger_integer ; cout << "\n This program is a computer game. Please, type in " << "\n an integer in the range 1 ... 2147483646 : " ; cin >> integer_from_keyboard ; one_larger_integer = integer_from_keyboard + 1 ; cout << "\n You typed in " << integer_from_keyboard << "." << "\n My number is " << one_larger_integer << "." << "\n Sorry, you lost. I won. The game is over. \n" ; }