@Alirez your program is undefined as well. The output is going to be completely different in different compiles, or even different versions of the same compiler. For example, on my computer, gcc prints 2 1 0, intel prints 0 0 1, and pathscale prints 2 0 1.