What is the type of conversion used here? int a = 'z';
Answers
Answered by
2
Answer:
Where?????????????????
Answered by
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:
- Implicit type conversion
- 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 char short int int unsigned int long float
double 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