All Exams Test series for 1 year @ ₹349 only
Question

If an integer needs two bytes of storage, then the maximum value of the signed integer is

The correct answer is

215 – 1

Calculating Bits for Magnitude Since one bit out of the total 16 bits is used for the sign, the remaining bits are used to represent the magnitude (the absolute value) of the number. Therefore, 15 bits are available to represent the magnitude of the signed integer. Therefore, the correct answer is 2 15 – 1.

Was this answer helpful?

Important Questions from Programming in C

  1. Which one is the reserved word in C language ?

  2. Which of the following is the feature(s) of High level programming languages?

    I. Portability

    II. Easy debugging

  3. Which of the following is a type of subprogram?

    I. Function

    II. Subroutine

  4. In object-oriented programming, which keyword ensures that a member variable belongs to the class itself rather than to any specific object, thereby allowing all instances to share a single copy of that variable?

  5. The condition num! = 65 cannot be replaced by

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App