~b -6 ?
The "~" flips all the bits, and negative numbers are represented using something called 2s complement. The -6 is just what happens when you flip all the bits of "5": you get a different bitpattern, which is the same bits as "-6" in 2s complement.
~(~a) 17 ?
Similar. Flip all the bits, then flip all the bits again, and what do you get? The same as before.
a=’A’ 65 ?
Internally, characters are represented by numbers, just like everything else in a computer. Virtually all these number<->character tables in use today are based on ASCII, and 'A' just happens to have the number 65 in the ASCII table.
a|’@’ 64 ?
That doesn't make sense. '@' is 64 (ASCII, again), which is hex 0x40. 0x40 | 17 should be 81.