A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-57.c
1#include<stdio.h>
2intmain(void){
3unsignedu=7;
4printf("%d\n",(-1<u)==(-1<1));
5return0;
6}
Numbers
Answer & explanation
Console output
0
Why
In -1 < u the int -1 is converted to unsigned (a huge value), so the comparison is false (0). In -1 < 1 both operands are int, so it is true (1). Comparing 0 == 1 yields 0. The only difference between the two comparisons is whether the right operand’s type pulls -1 into unsigned territory.