It probably depends on how streams work on your platform. What are you using? (If you're not sure show me the output of uname -a)
Try adding fflush(stream-name); after each printf and see what happens, i.e.:
fprintf(stdout,"hello-out\n"); fflush(stdout);
fprintf(stderr,"hello-err\n"); fflush(stderr);
Output is often buffered rather than printed immediately so this could be the cause of the behaviour.