As others have noted, this behavior is undefined, so there is no solid answer.
However, you are probably right that the most common values you get will be from 0 to 9. This will happen because the OS zeros out the memory occupied by the stack before your program receives it. foo() is the deepest call that has been made, so it uses memory that was not affected after the OS nullified it, so the first call it will probably still contain zero.
In each subsequent call, he is likely to occupy the same place on the stack, so at the beginning of each subsequent call he will probably start with the value at the end of the previous call.
Sine is undefined behavior, none of this is guaranteed at all, but yes, maybe it will be at least a little more likely.
source share