A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-47.c
1#include<stdio.h>
2intmain(void){
3intx=-8;
4printf("%s\n",x%2==0?"even":"odd");
5return0;
6}
Numbers
Answer & explanation
Console output
even
Why
Even-number parity tests with % 2 == 0 work for negatives because an even number has remainder 0, and zero has no sign. -8 % 2 is 0, so the ternary selects "even". (The sign-follows-dividend rule only matters for odd negatives, where % 2 yields -1, not 1.)