Q49.Marks: +2.0UGC NET Paper 2: Computer Science 2nd January 2026 Shift 1
For implicit type conversion, arrange the following from a lower size type to a high type size.
A. double
B. unsigned long int
C. unsigned int
D. long double
E. long int
Choose the correct answer from the options given below:
1.E, C, B, A, D
2.C, B, E, D, A
3.E, C, A, B, D
4.C, E, B, A, D✓ Correct
Solution
The correct answer is C, E, B, A, D.
Key Points
Implicit type conversion, also known as type promotion, occurs automatically by the compiler when a lower data type is converted to a higher data type.
The hierarchy for type conversion follows the data type size and precision. Smaller data types are promoted to larger data types for compatibility and precision.
The correct order of data types from lower size to higher size for implicit conversion is: unsigned int → long int → unsigned long int → double → long double.
This ensures no data loss occurs during the conversion process.
Additional Information
Details of the data types:
unsigned int: A 4-byte data type (on most systems) that stores only positive integers.
long int: A 4-byte or 8-byte data type (depending on the system) capable of storing larger integers compared to int.
unsigned long int: A 4-byte or 8-byte data type for larger positive integer values.
double: An 8-byte floating-point data type used to store decimal numbers with double precision.
long double: A 10-byte or 16-byte floating-point data type (depending on the system) used for extended precision decimal numbers.
Why implicit conversion is necessary:
It ensures that operations involving different data types are performed accurately and without data loss.
For example, adding an integer to a floating-point number promotes the integer to a floating-point number before the operation.
Important Points:
Implicit conversion follows a strict hierarchy to prevent loss of information.
When precision and size differ, the data type with higher precision or size is chosen for promotion.
Explicit typecasting can be used if implicit conversion does not meet the desired outcome.