+ 1
Hello! Somebody explain me how is taking division from remainder, for example a%2, where 'a' value is zero, one, two...
Sometimes I forget how it working 😅
2 ответов
+ 4
It is simple it told us in our school days when we devide 0 with any no then it will be divisible with quotient 0 and remainder 0 .
Next we will devide 1 with 2 then then obviously we can't do that because 1 is an int and 2 is also an int . So it will result in float so here it will simply return 1 as remainder because it will not devide 1 .
And for 2 you know that it is completely divisible by itself so no remainder.
+ 2
ok, thanks for remember, I see when we get a float result it remain us logical "1".