6) The ~ operator should be used carefully
The result of ~ operator on a small number can be a big number if result is stored in a unsigned variable. And result may be negative number if result is stored in signed variable (assuming that the negative numbers are stored in 2ās complement form where leftmost bit is the sign bit)
// Note that the output of following program is compiler dependent
int main()
{
unsigned int x = 1;
printf("Signed Result %d \n", ~x);
printf("Unsigned Result %ud \n", ~x);