As others have noted, it's undefined behavior, so there's no solid answer.
That said, you're probably right that the most common values you'd get would be 0 through 9. This would happen because the OS zeroed out the memory being occupied by the stack before your program received it. foo()
represents the deepest call that's been made, so it's using memory that hasn't been touched after the OS zeroed it, so on the first call, it's fairly likely to still contain zero.
On each subsequent call, it's likely to occupy the same spot on the stack, so at the beginning of each subsequent invocation, it's likely to start with the value it had at the end of the previous invocation.
Sine it is undefined behavior, none of this is guaranteed at all, but yes, it's probably at least a bit more likely than not.