Hardy &&& wrote:
I know that any number % 10 = zero.
Can any body give me the answer to C++ beginner?
what's result of:
2%500.
Thank you all.
No it's not. For any positive n, n % 10 == 0 if n is a multiple of 10,
n/10 + r otherwise (r is the remainder and / is integer division). For 0
< n < 10 the remainder is simply n and for n == 0 the answer is 0 since
0/n == 0 for any n != 0. So 2 % 500 == 2. What's the problem?