6
You're actually seeing the output of two copies of the executable. When you call fork(), the process clones itself, giving two processes. The parent gets the child process's PID as the return value, and the child gets 0 as a return value.
The trick is, the clones share STDIN, STDOUT, and STDER...