What is the output for the following code?
public class Test
public static void Main(string args)
int x = 258;
short s = x;
Higher range data type cannot be converted to lower range data type using Implicit conversion. Explicit conversion is required for converting higher range data type to lower range data type.
Int capacity is 4 bytes and short capacity is 2 bytes and hence compiler will not allow to copy data from int type to short type
Back To Top