basics · beginner · ~15 min
Use & to test the low bit.
Implement int is_even(int n) returning 1 if n is even, else 0, using the bitwise AND operator.
int is_even(int n) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.