Two things that are not mentioned in the other solutions but might be of interest to the beginner:
- It works since
printf(...) returns a non-0 value (the number of printed characters) and since any value not equal to 0 is interpreted as true in C.
- The only purpose of the whole
x && y & z is to evaluate one after the other: first
x evaluates to true, do
y evaluates to true, do
z. The result is not stored, and therefore, it does not matter that the tail call of
main() returns 0 = false - it does the recursion internally before it can return the 0 value.