Program in C#:
short a, b; a = 10; b = 10; a = a + b; // Error : Cannot implicitly convert type \'int\' to \'short\'. // we can also write this code by usin
This is because += is implemented as an overloaded function (one of which is a short, and the compiler chooses the most specific overload). For the expression (a + b), the compiler widens the result to an int by default before assigning.