A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-112.c
1#include<stdio.h>
2intmain(void){
3inti=-1;
4unsignedu=1;
5printf("%u\n",i+u);
6return0;
7}
Numbers
Answer & explanation
Console output
0
Why
Because one operand is unsigned, i is converted to unsigned: -1 becomes UINT_MAX. Adding 1 then wraps modulo 2^32 back to 0. The arithmetic is well-defined, and the surprising part is that the conversion, not the addition, is where -1 transforms.