Question:medium

Arrange the following data types available in C language according to their size (smallest to largest): 
A. signed long int 
B. long double 
C. unsigned char 
D. unsigned int 
Choose the correct answer from the options given below:

Show Hint

Data types in C vary in size depending on the architecture. It's important to understand their size for efficient memory usage.
Updated On: Jan 17, 2026
  • A, B, C, D
  • B, A, C, D
  • B, A, C, D
  • C, D, A, B
Show Solution

The Correct Option is D

Solution and Explanation

Step 1: Determine C data type sizes.
Data type sizes in C are system-dependent. Common sizes are:

- unsigned char: Smallest, typically 1 byte. 

- unsigned int: Typically 4 bytes.

- signed long int: Typically 4 bytes, sometimes 8 bytes.

- long double: Largest, often 8 or 10 bytes.

Step 2: Order the data types by size. 
- C (unsigned char): Smallest (1 byte). Placed first.

- D (unsigned int): Next smallest (4 bytes).

- A (signed long int): Larger (4 or 8 bytes).

- B (long double): Largest (8 or 10 bytes).

Step 3: Final order. 
The order from smallest to largest is: C, D, A, B.

Was this answer helpful?
0

Top Questions on Programming in C