HINT: The modulo % operator yields the remainder of division and the quotient is ignored.
HENCE: 5 ÷ 2 = 2.5, but 5 % 2 = 1 {1 remaining after dividing 5 by 2}. Refresh this page. |
11 random numbers | 90 | 51 | 477 | 145 | 105 | 106 | 152 | 107 | 342 | 52 | 78 |
---|---|---|---|---|---|---|---|---|---|---|---|
multiply by 3 | 270 | 153 | 1431 | 435 | 315 | 318 | 456 | 321 | 1026 | 156 | 234 |
sort from left to right | 153 | 156 | 234 | 270 | 315 | 318 | 321 | 435 | 456 | 1026 | 1431 |
shift to the right | 0 | 153 | 156 | 234 | 270 | 315 | 318 | 321 | 435 | 456 | 1026 |
modulo remainder | 153 | 3 | 78 | 36 | 45 | 3 | 3 | 114 | 21 | 114 | 405 |
sort from left to right | 3 | 3 | 3 | 21 | 36 | 45 | 78 | 114 | 114 | 153 | 405 |
shift to the right | 0 | 3 | 3 | 3 | 21 | 36 | 45 | 78 | 114 | 114 | 153 |
modulo remainder | 3 | 0 | 0 | 0 | 15 | 9 | 33 | 36 | 0 | 39 | 99 |
sort from left to right | 3 | 9 | 15 | 33 | 36 | 39 | 99 | ||||
shift to the right | 0 | 3 | 9 | 15 | 33 | 36 | 39 | ||||
modulo remainder | 3 | 0 | 6 | 3 | 3 | 3 | 21 |