Your problem is not the loop. When you fork a program the child created starts execution right after the fork call. You are basically duplicating the parent. The reason your print statement executes...