Multiple choice technology programming languages

Which of the following conversions paths are widening conversions? (Choose two) You have not made any correct choices. The correct options are as follows

  1. 1From a int to a short

  2. 2From a char to an int

  3. 3From a short to an int

  4. 4From a double to a float

  5. 5From a float to a long

Reveal answer Fill a bubble to check yourself
B,C Correct answer
Explanation

Widening conversions convert a smaller primitive type to a larger type without data loss: char to int (16-bit to 32-bit) and short to int (16-bit to 32-bit) are both widening. Options A, D, and E are narrowing conversions (int to short loses precision, double to float and float to long lose range or precision). Widening conversions happen automatically without casting.