Modulo (%) means, what is the remainder after I divide the left-hand-side (lhs) from the right-hand-side (rhs) operands. Another way of saying it is, how much is left over after I divide 2 into 3 parts? Well, you can't divide 2 into 3 parts, so 2 is left over. If we write 3 % 3, the question is "how many are left over after dividing 3 by 3?" The answer is zero, because 3 exactly divides 3. 4 % 3 = 1 When you divide 4 by 3, you get 1, with 1 left over.
Originally posted by Ratna Singh: thanks for the response. I am new to the Ranch and after adding to the thread I was wondering if you can add questions/doubts to an old thread and if it is active and read.
If you read a thread and have a question about it, you can always post a reply within that thread. That thread will then get popped to the top of the list in the forum so that everyone will take notice. Corey