Multiple choice

If C language uses two bytes of memory for storing the integer data type, what is the maximum value that an integer data type accommodates?

  1. 216

  2. 215-1

  3. 215

  4. 215+1

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

If any integer data type uses n bytes, then its maximum range will be 2(No of bits -1)-1. In this case, 2 Bytes = 16 bits 2(16-1) - 1 = 215-1=32768-1=32767