VB.Net program to print the binary number of a decimal number
'VB.Net program to print the binary number
'of a decimal number.
Module Module1
Sub Main()
Dim iLoop As SByte
Dim num As SByte
Console.Write("Enter Number: ")
num = Byte.Parse(Console.ReadLine())
For iLoop = 7 To 0 Step -1
If ((1 << iLoop) And num) Then
Console.Write("1")
Else
Console.Write("0")
End If
Next
Console.ReadLine()
End Sub
End Module
Output
Enter Number: 8
00001000
Table of Contents