Regarding the no 11111111111

how shell we know that the given no is negative as its ans is -1 and it could be also around 2055 in dercimal but how we know that it is in 2s complement notation

Hey @Pranjul see the main idea behind this is to store negative nos in binary we simply use the leftmost bit of the number as a special value to represent the sign of the number : 0 = positive, 1 = negative . For example, a value of positive 12 (decimal) would be written as 000…1100 in binary , but negative 12 (decimal) would be written as 100…1100.

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.