static void Main(string[] args)
{
byte result = 255;
byte result2=2;
byte result1=1;
try
{
result2 = (byte) (result + result1);
Console.WriteLine(result2);
Console.Read();
}
catch(Exception e)
{
Console.WriteLine("Error : ");
}
}
I am getting output
0
But not the catched exception.
When I debugged the code, I got, that in result2 = (byte) (result + result1);, result2 becomes 0 automatically.
Why?