%=is a compound operator. He looks likea = a % b
% used balance
5 %= 2;
6%=2;
Commonly %used to match many elements with fewer elements.
So, if you have 100 elements and you want to match them to say an array of 20 elements. You can use% operator
99%20;//19...So assign 99 to array index 19
50%20;//10...So assign 50 to array index 10
source
share