Bitmask ~ quiz doubt

sir i have a doubt that in video lecture ~ means to flip bits
10 = 1 0 1 0
~10 =0 1 0 1=5 in my view but when i run it on ide it gives -11 as o/p.
and sir please also explain the difference between ~ and - .

hello @Ankit_kumar_3003
image

basically ~ return ones complement.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.