Question:Which of the following expression causes a compile-time error in C#?
A short x=1, y=1;
short z=(short) (x+y);
B short z=1+2;
C short x=1, y=1;
short z=x+y;
D short z=2000+4333;
/59
+ Answer
C
+ ExplanationThe 8-bit and 16-bit integer types are byte, sbyte, short, and ushort. These types lack their own arithmetic operators, so C# implicitly converts them to larger types as required. In this case, x and y are implicitly converted to int.