Hello, I have a little doubt in 2’s complement. Suppose we want to store -5 in a variable(memory). As the datatype int consumes 4 bytes(32 bits) of memory hence 5 is written as:
00000000000000000000000000000101
Using 2’s complement we will write -5 as:
10100000000000000000000000000001
Is this right or is there something that I am missing or getting confused into ?