It used to be mandatory to declare local residents in C, presumably because it is easier to implement a compiler when that is.
Nowadays, the compiler is actually "quite advanced", which does not matter for POD types. Because of this, the question boils down to readability and taste issues in C.
In C ++, however, declaring locals implies things about executing the appropriate constructor and destructor, and this may have to do with whether the compiler can use certain optimizations. This means that declaring them all at the top is not equivalent to declaring them on demand, which makes your question mostly invalid for C ++.
In C ++, declare variables when they are semantically correct for the program you are trying to write. (And besides, there are also issues of readability and taste)