Task

Test whether an integer is even or odd.

There is more than one way to solve this task:

 Use the even and odd predicates, if the language provides them.
 Check the least significant digit. With binary integers, i bitwise-and 1 equals 0 iff i is even, or equals 1 iff i is odd.
 Divide i by 2. The remainder equals 0 iff i is even. The remainder equals +1 or -1 iff i is odd.
 Use modular congruences:
 i ≡ 0 (mod 2) iff i is even.
 i ≡ 1 (mod 2) iff i is odd.


 
>100 p i# jz-1 o# t h#1 ms jz2003 p >0110 h#2 r ms t h#1 ms p 
jz1002 h? jz2003 p jn0110 h#10 o$ p jn100 >2003 p p h#0 h#10 
h$d h$d h$o h#32 h$s h$i h#32 jn0000 >1002 p p h#0 h#10 
h$n h$e h$v h$e h#32 h$s h$i h#32 >0000 o$ p jn0000 jz100
 