Check out second run of same code: http://ideone.com/TK4qu. This time it printed only 8 times.
The reason behind this is that, you are using a web based compiler and it sends back the output as soon as main completes its execution. However forked child are yet to complete. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/TYDV9_VeO-QJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.