/*------------------------------------------------------------------------------ T.I.A.S. Modulus Operator Perhaps surprisingly the remainder operator can be used with floating point values as well. It's surprising because you don't normally think of real number division as producing remainders. However there are rare times when it's useful to ask exactly how many times does 1.5 go into 5.5 and what's left over? The answer is that 1.5 goes into 5.5 three times with one left over, and it's that one which is the result of 5.5 % 1.5 in Java. ------------------------------------------------------------------------------*/ public class ModClient { public static void main (String args[]) { int i = 10; int j = 3; System.out.printf("\n\n\t i is %d" , i); System.out.printf("\n\t j is %d" , j); int k = i % j; System.out.printf("\n\t %d mod %d is %d" , i,j,k); System.out.printf("\n\n"); } }