Display Integer Value in Binary Octal and Hex forms
Imports System.Globalization
Module Example
Public Sub Main()
Dim numbers() As Integer = { -123, 11111, 9999 }
For Each number As Integer In numbers
Console.WriteLine("{0,8} {1,32} {2,11} {3,10}", _
number, Convert.ToString(number, 2), _
Convert.ToString(number, 8), _
Convert.ToString(number, 16))
Next
End Sub
End Module
Related examples in the same category