0
Whats is the mathematics operation of this? Is a division or whats....
int x=7; x= x%2;
3 odpowiedzi
+ 4
It is a modulo operator
https://en.m.wikipedia.org/wiki/Modulo_operation
+ 3
it gives the remainder for example
5%3=2
6%3=0
the answer for a%b ranges from 0 to b-1
+ 3
It is modulo operator.
7%2 it divides 7 by 2 and returns the remainder, so 7/2= 3 and remainder 1 or 7= (3*2) +1
7%2 = 1