A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-50.c
1#include<stdio.h>
2intmain(void){
3floatf=2.5f;
4printf("%d\n",(int)f+(int)f);
5return0;
6}
Conversions
Answer & explanation
Console output
4
Why
Each (int)f truncates 2.5 to 2 independently, so the sum printed is 2 + 2 = 4. The two half-units are discarded separately and never combine into a whole, which is why the answer is 4 rather than 5. Truncation is applied per cast.