I need to divide a number and get the remainder using the Modulus Assignment operator. % or %= but have not been able to get it to work. Anyone use this operator.
The way %= works is that the remainder will be placed in the variable that held the value being divided. In other words, you can't use %= with a third variable. In your case above, you would use B %= A to replace the Mod = B % A line, but then you would use your original value in B.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.