Class Sample
Public Shared Sub Main()
Dim bases() As Integer = { 2, 8, 10, 16}
Dim numbers() As Short = { Int16.MinValue, -2010, -18, 12, 2010, _
Int16.MaxValue }
For Each base As Integer In bases
Console.WriteLine("Base {0} conversion:", base)
For Each number As Short In numbers
Console.WriteLine(" {0,-8} --> 0x{1}",number, Convert.ToString(number, base))
Next
Next
End Sub
End Class