practice and experience are your two best friends in learning how to program :P

Go through the examples (compile them and run them), then try to see if you can figure out what the code is doing....