Because
while ((c = getchar()) != EOF) {
//
}
Is considered more idiomatic and readable than any alternatives that's not assigning to c within the conditional.
You'll see similar idioms in many other languages, e.g. while((line = reader.readLine()) != null) {
}
But if you're talking about e.g. if (foo = (bar & 0xf)) {
}
It's just bad style ...