Could someone please confirm what the following line does...
n %= 5;
(where n is an integer).
Thanks.
Could someone please confirm what the following line does...
n %= 5;
(where n is an integer).
Thanks.
In your case n%=5 can be translated into
n = n % 5 which in turn means: Return the remainder from dividing n by 5 and store the result to n. This has the same effect as keeping n in the range of 0 to 4.