Let us consider two numbers as a and b when you divide a/b = n multiply b*a to get the c. Subtract b from c to find the result r. a mod b = r.