1.69 – int Data Type Range Explained (2 Bytes) | Why after 32767 Becomes Negative ? | New Series

Опубликовано: 06 Август 2026
на канале: Burle Sharma (geecoding)
35
1

Welcome to the C Programming – Complete Course (New Series) by Burle Sharma.

In this class (1.69), we understand how the range of the int data type is determined when int occupies 2 bytes, as seen in Turbo C++.

We begin by revising:

📌 1 byte = 8 bits
📌 2 bytes = 16 bits

Out of 16 bits:

1 bit is reserved for the sign
15 bits are used to store the value

Range calculation:

Positive range: 0 to 32767
Negative range: -32768 to -1

Total values: 2¹⁶ = 65536

Practical observation explained:

✔ When we store values within 32767, output is correct
✔ When we store 32768 or more, the value turns negative

Examples explained with logic:

32767 + 1 → -32768

32768 → -32768

32769 → -32767

This happens due to binary overflow, where the sign bit becomes 1, indicating a negative number.

🎓 What you’ll learn in this video:

✔ Why Turbo C++ uses 2 bytes for int
✔ How int range is calculated using bits
✔ Meaning of sign bit in int data type
✔ Why exceeding 32767 produces negative values
✔ Step-by-step calculation behind overflow
✔ Clear relation between memory and output

🧠 Key Learning Point:
Data types do not understand “large numbers”, they only store bits.
When bits overflow, values wrap around into negative range.

#CProgramming #LearnC #BurleSharma #CProgrammingNewSeries #IntDataType #IntegerOverflow #TurboC #CDataTypes #SignedInt #MemoryInC #CForBeginners #CConcepts#geecoding