The following is an excerpt from the C book by Mike Banahan & Brady (Link: Section 2.8.2.1). A pleb like me has no reason to doubt that the author is wrong, unless you folks suggest otherwise.
Please tell me how on earth "(a/b)*b + a%b - a" is always zero for integers where b is not zero.
Extracted text follows:
If either operand is negative, the result of / may be the nearest integer to the true result on either side, and the sign of the result of % may be positive or negative. Both of these features are implementation defined.
It is always true that the following expression is equal to zero:
(a/b)*b + a%b - a
unless b is zero.
The usual arithmetic conversions are applied to both of the operands.