c99 standard says that result of modulo operation has same sign as first operand. So -9 % 7 = -2
and 9 % -7 = 2
.
I read in one book that c89 standard depends on implementation. So -9 % 7
could yield -2
or 5
??? How remainder of -9 / 7
could be 5
?