0
Check the number even or odd without using division or modules
tell someone plz
4 ответов
+ 4
% is a division operation. a & 1 == 0 in case if a is odd.
+ 3
(n>>1)<<1==n is true if n is even
+ 1
n % 2 == 0
returns true if n is even
+ 1
Check if last digit is in [0, 2, 4, 6, 8] or in [1, 3, 5, 7, 9]