Operators and Expressions:Checked and Unchecked Expressions : checked unchecked « Data Types « C# / C Sharp






Operators and Expressions:Checked and Unchecked Expressions


using System;

public class CheckedandUncheckedExpressions
{
    public static void Main()
    {
        unchecked
        {
            byte a = 55;
            byte b = 210;
            byte c = (byte) (a + b);
        }
    }
}
           
       








Related examples in the same category

1.OverflowCheck
2.Checked and Unchecked
3.Checking for overflows.
4.unchecked int overflow
5.Demonstates using checked keyword to detect an overflowDemonstates using checked keyword to detect an overflow
6.Demonstates using checked keyword to detect an overflow 2Demonstates using checked keyword to detect an overflow 2