Managing Processes In LINUX - fork(), wait()

In the code below I'm trying to create a child process and first let the child process do its work then parent process finish execution. I use wait() function in the parent process but the output shows that child process finishes last.

Wow! The problem was with the text editor. It did not compile the latest version of the code. I like Linux but when it comes to IDE Visual Studio absolutely rules. Is it too hard to create a good and responsive IDE???