0
I still don't get the % sign
What does it do? help
6 Respostas
+ 2
it's called the modulo or remainder operator, it returns the remaining number after dividing the first number by the second.
eg: 9/2 gives 4.5 to quickly get the remainder just multiply the decimal place (.5) by the divisor (2), this gives 1.
so 9%2 = 1;
+ 2
% Is the remainder . Like if you have 5 and someone asks you how many times can you put 2 inside of 5, Well 2 times since 2+2 is 4, that leaves 1 remaining.
0
a%b gives you the remainder of a divided by b.
https://en.wikipedia.org/wiki/Remainder#Integer_division
0
remember how you used to divide in elementary school? well the modulo is about the remainder of a division
0
Thanks. I figured it out