// game.m (c) Kari Laitinen www.naturalprogramming.com // 2013-06-01 File created. // 2013-06-01 Last modification. // This prigram is an example of a simple Objective-C program. // It is also a valid C program. // This can be compiled in MacOS Terminal window with the command // gcc game.m -o game.out // After compilation it can be executed by typing // ./game.out // The gcc compiler must be inslalled to make the compilation succeed. #include int main() { int integer_from_keyboard ; int one_larger_integer ; printf( "\n This program is a computer game. Please, type in " ) ; printf( "\n an integer in the range 1 ... 2147483646 : " ) ; scanf( "%d", &integer_from_keyboard ) ; one_larger_integer = integer_from_keyboard + 1 ; printf( "\n You typed in %d \n My number is %d", integer_from_keyboard, one_larger_integer ) ; printf( "\n Sorry, you lost. I won. The game is over. \n\n" ) ; return 0 ; }