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 happens because int is the smallest signed type for which + is defined. Anything smaller is first promoted to int. The += operator is defined with respect to +, but with a special-case rule for handling results that don't fit the target.
+
+=