How to find the MaxValue and MinValue of UInt16 in C# ?

You can find the max value and min value of the unsigned integer in c# using the properties UInt16.MaxValue and UInt16.MinValue .

Below is a sample sourcecode demonstrating the MaxValue and MinValue of UInt16 in C#

static class Program
{
        static void Main()
        {
            MessageBox.Show("Max value for UInt16 : " + UInt16.MaxValue);
            MessageBox.Show("Min value for UInt16 : " + UInt16.MinValue);
        }
}

Output

Max value for UInt16 : 65535
Min value for UInt16 : 0

%d bloggers like this: