Output:-
Signed Result = -2
Unsigned Result = (4294967294)10
Explanation:-
Now, x = 1 in decimal
and in binary 0000 0000 0000 0000 0000 0000 0000 0001
operator ~ is complement of given number.
1's complement of x = 1 --->>> 1111 1111 1111 1111 1111 1111 1111 1110
and its unsigned value is = 4294967294
For signed value use 2's complement notation. Computers uses 2's complement to represent negative numbers.
1111 1111 1111 1111 1111 1111 1111 1110 Representing in 2's complement notation gives -2.