Computer Science, asked by kusuma88, 7 months ago

What is the type of conversion used here? int a = 'z';

Answers

Answered by BLACK1817
2

Answer:

Where?????????????????

Answered by mad210203
0

Implicit Type conversion

Explanation:

  • A typecast is basically a conversion from one data type to other data type.
  • There are two types of conversion:
  1. Implicit type conversion
  2. Explicit type conversion

Implicit type conversion:

  • It is known as promotion or automatic type conversion.
  • In this conversion, small data type is converted into larger data type.
  • It is automatically done by the compiler on its own.
  • It takes place to avoid loss of data.
  • In this conversion, smallest data type are converted into largest data type.

        Bool \longrightarrow char \longrightarrow short int \longrightarrow int \longrightarrow unsigned int \longrightarrow long \longrightarrow float

        \longrightarrow double \longrightarrow long double

  • So, in int a = 'z', z is a character. It is assigned to a variable 'a' of type integer. So, here smaller data type is converted into larger data type.
  • Therefore, it is implicit type conversion.
Similar questions