A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-173.c
1#include<stdio.h>
2intmain(void){
3unsignedcharc=(unsignedchar)300;
4printf("%u\n",c);
5return0;
6}
Conversions
Answer & explanation
Console output
44
Why
Casting to unsigned char applies the same modulo-256 reduction as an implicit conversion: 300 mod 256 equals 44. The explicit cast does not change the numeric rule; it only silences the warning. Unsigned conversion wraparound is fully defined by the standard.