I think it's different. fork() returns 0 to the child and the pid (or error indication) to the parent.
So after line 13, the child executes line 15 and then exits at line 16. The parent continues on to line 18
After line 22, the child executes line 24 and exits at line 25. The parent continues to line 27.
Ideally you should call join() to get the status of the child procs. Otherwise eventually init will get them.