In the conventional data model of a 16-bit C compiler, the size of long int is:

2019

In the conventional data model of a 16-bit C compiler, the size of long int is:

Answer: B. 32 bitsConceptIn C, integer-type widths are implementation-defined, but long int must represent at least the range −2,147,483,647 to 2,147,483,647. Traditional…

  1. A.

    8 bits

  2. B.

    32 bits

  3. C.

    16 bits

  4. D.

    24 bits

Attempted by 4 students.

Show answer & explanation

Correct answer: B

Concept

In C, integer-type widths are implementation-defined, but long int must represent at least the range −2,147,483,647 to 2,147,483,647.

Traditional 16-bit C data models use a 16-bit int and a 32-bit long int.

Application

  1. Use the conventional 16-bit C data model named in the stem: long int occupies 4 bytes in that model.

  2. Convert bytes to bits using 8 bits per byte: 4 × 8 = 32 bits.

Contrast

  • 8 bits is one 8-bit byte, which is narrower than even the conventional 16-bit int in this model.

  • 16 bits is two 8-bit bytes and is the conventional width of int, not long int, in this model.

  • 24 bits is three 8-bit bytes and is not the conventional long int width used by this data model.

Cross-check

A signed 16-bit object reaches only 32,767, whereas long int must represent values through at least 2,147,483,647. A 32-bit signed representation meets that minimum range, confirming 32 bits.

Explore the full course: Uppsc Computer Operator Grade B

Loading lesson…