Which one of the following is not a widening conversion rule?

  1. Short integer to character

  2. Integer to long integer

  3. Floating-point to double precision floating-point

  4. Character to floating-point


Correct Option: A

AI Explanation

To answer this question, you need to understand the concept of widening conversions. Widening conversions are conversions that do not result in any loss of data or precision. Let's go through each option to understand why it is correct or incorrect:

Option A) Short integer to character - This option is incorrect because it is a valid widening conversion rule. When a short integer is converted to a character, it is promoted to an int first and then converted to a character.

Option B) Integer to long integer - This option is incorrect because it is a valid widening conversion rule. When an integer is converted to a long integer, it is promoted to a long integer without any loss of data or precision.

Option C) Floating-point to double precision floating-point - This option is incorrect because it is a valid widening conversion rule. When a floating-point value is converted to a double precision floating-point value, it is promoted to a double precision floating-point without any loss of data or precision.

Option D) Character to floating-point - This option is correct because it is not a valid widening conversion rule. Converting a character to a floating-point value is considered a narrowing conversion, as it can result in a loss of data or precision.

Therefore, the correct answer is Option D. This option is not a widening conversion rule because it involves a narrowing conversion.

Find more quizzes: