public static void Main()
short[] numbers = { Int16.MinValue, -132, 0, 121, 16103, Int16.MaxValue };
foreach (short number in numbers)
result = Convert.ToUInt16(number);
Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.",
number.GetType().Name, number,
result.GetType().Name, result);
catch (OverflowException) {
Console.WriteLine("The {0} value {1} is outside the range of the UInt16 type.",
number.GetType().Name, number);