My friend said that there are differences between "mod" and "remainder".
If so, what are those differences in C and C++? Does '%' mean either "mod" or "rem" in C?
There is a difference between modulus and remainder. For example:
-21
mod 4
is 3
because -21 + 4 x 6
is 3
.
But -21
divided by 4
gives -5
with a remainder of -1
.
For positive values, there is no difference.