While i used this code i got the output as "The value is 0"
int var1 = 2147483647;// Maximum limit of int
short var2;
var2 =(short)var1;
var2 +=1;
Console.WriteLine("The value is {0}",var2);
I got error : Cannot implicitly convert type 'int' to 'short' while i tried to use var2 = var2 + 1; Instead of var2 + =1;
What is the reason behind this confusion ?