Maybe you are a bit confused between Programming and Scripting languages, though the demarkation is a bit fuzzy but Scripting langs are meant to be simplify the task of the programmer and carry out repetitive tasks in an automated and easy manner. They have inbuilt automatic garbage collector. They are mostly interpreted languges (no object file is formed). Some egs are the famous Perl, PHP, Python etc.
C, C++, JAVA are programming languages in the way that they require a compilation phase before the execution phase.
The program which you have written in your first post can easily be compiled and run on any of the compilers present in the link given to you by Mr. Ancient Dragon. So download the compiler and IDE and try running the code. If you still face problems then repost.
gcc only compiles your program into an executable file, it does not run your program. The default name of your program is a.out because you did not tell gcc what to name it. So to run your program, try this:
Use ls command to search the directory and see if it contains a file called a.out. If not, then gcc probably did not compile it. If it didn't then compare your program with what ~S.O.S.~ posted and make sure it is identical. And from here I think you need to start reading some of the links that were posted in the sticky at the top of this board. I know its a lot of reading, but if you want to learn how to program you must also be willing to do a lot of reading and studying.
Its good that you are going to buy a book, that's the best way to learn. But that book won't teach you a thing about gcc compiler or how to use linux. you need to learn how to compile and execute a program before that book (or most any other book for that matter) will be much help to you.
I did not mean for you to type "<Enter key>" on the command line -- that only meant that you should have hit the Enter key on the keyboard. If you actually typed that text, then try it again without that part. just