Your program exposes undefined behaviour, since c
is not initialized.
Actually every answer predicting the result of c
is wrong, even if one said "it's garbage". Your variable c
is a local variable with automatic storage duration, so it does not get initialized per se; In expression ++c
, your variable is an lvalue as it designates an object. See what the standard says concerning lvalues and non-initialized (cf., for example this online C11 standard draft):
6.3.2.1 Lvalues, arrays, and function designators
1...
2... If the lvalue designates an object of automatic storage duration that could have been declared with the register storage class (never
had its address taken), and that object is uninitialized (not declared
with an initializer and no assignment to it has been performed prior
to use), the behavior is undefined.