My C is a bit rusty... You don't have to declare the function first, but if you don't, the C compiler will assume the function returns an int (even if the real function, defined later, doesn't). It's a bit strange, but this is how C works. It's a good idea to always declare functions before you call them.
Doesn't the compiler give you a warning if you do this? Most modern C compilers will give a warning if you do this.
Maybe you can change the settings that NetBeans uses to call gcc. I haven't programmed in C for a long time, so I don't know how to do that, but it's probably not hard to find in the preferences of NetBeans. When calling gcc from the command line, it's usually a good idea to use -Wall (which means: turn on all warnings), for example:
gcc -Wall hello.c -o hello
I'm sorry but I don't have a good book recommendation for C - I learned C a long time ago, on the Amiga when I was 16 or so.