The answer to the first question is 2. When you take the modulus of a negative number, think of it as rounding down to a multiple of the divisor and taking the remainder. If you round down -22 to a multiple of 3, you get -24, and the difference between -22 and -24 is 2, your remainder.
I'm not sure about having a negative modulus, but since you know the answer, I'm assuming it's the same as the first problem, except you take the opposite of the remainder, so 22 % 3 is 1, but the opposite of what's left would leave you 2. I have no clue about the third, but my guess is 1. My assumption is that the two will cancel each other out and cause you to perform a regular modulus, 22 % 3. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---