Memory representation of unsigned char a= 7;
1 bit: signed bit
Note: In C, negative number is stored in the 2’s complement format.
Signed bit is 0: Number is positive.
Signed bit is 1: Number is negative.
Memory representation of char a=7;
For 8 bit we will add 5 zero in the left side i.e. 00000111. Memory representation:
Binary equivalent of 7 is 111
For 8 bit we will add 5 zero in the left side i.e. 00000111. Since a is negative number so it will store in the memory in the 2’s complement format