1. ## simple modulus question

Why is this printing 0 instead of 5? Doesn't the modulus operator
result in the remainder after a division?

Code:
```int main(void)
{
int c = 0;
int remainder = c % 5;

printf("%d\n", remainder);
return 0;
}```
thanks

2. Suppose that the remainder of dividing 0 by 5 is 5.

If this is true, then here's a simple get rich quick scheme: let n be the number of people in the world. Divide \$0 by n. You get to keep the remainder, \$n. You now have about 6 billion dollars in your hand. Repeat until you are satisfied.

3. thanks laserlight.

I think I got it (maybe).

4. the first operand is divided by the second operand to produce the remainder (eg, in this case, 0 is divided by 5, which results in "0 R 0")

if you switch the two operands around (ie, 5 &#37; 0) you will get a divide-by-zero error, but theoretically I guess 5 should be returned

5. > if you switch the two operands around (ie, 5 &#37; 0) you will get a divide-by-zero error, but theoretically I guess
> 5 should be returned

If you / or % by 0, the result is undefined (anything can happen).

6. If you / or &#37; by 0, the result is undefined (anything can happen).
Yes, I stand corrected =)
sorry, I was thinking in java.