[Solved] Why does the following programme gives output as “-128” despite its value assigned as “128”? [duplicate]
Do you know about integer limits? A char value takes up 1 byte. A byte is usually 8 bits. To calculate the limit through the number of bits, the calculation is 2^n-1 meaning an integer with 8 bits has a range from 0 to 255 when unsigned. Since your variable is signed, it allocates a … Read more