VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Converting Decimal Numbers to Binary

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

Rate 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

Download this snippet    Add to My Saved Code

Converting Decimal Numbers to Binary Comments

No comments have been posted about Converting Decimal Numbers to Binary. Why not be the first to post a comment about Converting Decimal Numbers to Binary.

Post your comment

Subject:
Message:
0/1000 characters