$\text{i = -1 => }$${\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}} \ \ (32 \ bits)$
$\text{we are converting "int"(32 bits) into "unsigned char" (8 bits) so "truncation" will happen i.e }$
$\underset{\text{32 bits}}{\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}\boxed{1111 \ \ 1111}}⇒$ $\underset{\text{truncated 8 bits}}{\boxed{ \ 1111 \ \ 1111 \ }}$
$\text{Now its storing inside "int" again, so "bit extension" will happen and due to unsigned, remaining bits will be filled with "0"}$
$i.e \ \ \boxed{ \ 1111 \ \ 1111 \ } ⇒ $ $\boxed{0000 \ \ 0000}\boxed{0000 \ \ 0000}\boxed{0000 \ \ 0000}\boxed{1111 \ \ 1111} ⇒ 2^{8} - 1 = + \ 255$
$\newline$
$\color{Orange}\text{Output : }$ 255