1.

Type of Conversion in which compiler is unable to convert the data type implicitly is?(a) ushort to long(b) int to uint(c) ushort to long(d) byte to decimalThis question was posed to me in my homework.I would like to ask this question from Type Conversion in Expressions in chapter Data Types, Variables and Operators of C#

Answer»

The CORRECT CHOICE is (b) INT to uint

For explanation: ‘int’ is 32 bit signed integer whereas ‘uint’ is 32 bit unsigned integer. RANGE of int is larger than uint. So, the compiler cannot implicitly convert from larger data type to smaller data type.



Discussion

No Comment Found

Related InterviewSolutions