X86 Assembly code
In fact, if you perform modular arithmetic on powers of 2, you can always convert it into bitwise operations.
Some compiles (e.g., GCC) also produce bitwise operation assembly code smartly.
.LC0: .string "%u" .LC1: .string "Odd" .LC2: .string "Even" main: push rbp mov rbp, rsp sub rsp, 32 mov DWORD PTR [rbp-20], edi mov QWORD PTR [rbp-32], rsi mov DWORD PTR [rbp-4], 0
In my machine, one word is equivalent to 16 bits.
lea rax, [rbp-4]
load var i address into rax
mov rsi, rax mov edi, OFFSET FLAT:.LC0 mov eax, 0 call scanf mov eax, DWORD PTR [rbp-4] and eax, 1
do AND operation
test eax, eax
it is equivalent to "cmp eax,0"
je .L2 mov edi, OFFSET FLAT:.LC1 call puts jmp .L3 .L2: mov edi, OFFSET FLAT:.LC2 call puts .L3: mov eax, 0 leave ret