by Ahamed Saifudeen (11 Submissions)
Category: Math/Dates
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 7th December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Converting Decimal Numbers to Binary
n = InputBox("Enter an Decimal Number:")
b = Binary_Function(n)
MsgBox b
End Sub
Function Binary_Function(n As Integer)
Dim s As String, i As Integer
For i = 0 To 7
s = (n Mod 2) & s
t = n / 2
n = Int(t)
Next
Binary_Function = s
End Function