Convert Integer to its Binary, Octal, Hex forms
Imports System
Imports Microsoft.VisualBasic
Module MainClass
Sub Main( )
Dim numbers() As Integer = { -999, 9999, 999999 }
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