Convert Decimal to Binary (VB)

DonnaF

Freshman
Joined
Mar 20, 2003
Messages
30
Convert Decimal to Binary

I need to convert a decimal to binary, and display the binary value. Does anyone know of a way to do this?

Thanks, Donna
 
There will be loads of algorithms for this on the internet, i remeber i wrote one for my AS Level course when i have about 15. Anyway - yeah.
 
Well, one way to go about it (if you are still here :( )
Visual Basic:
Q = 65536
Do
    D2B &= (Decim \ Q)
    Decim -= (Q * (Decim \ Q))
    Q = Q \ 2
Loop While Q > 0
I did something like this in VB6, but should be easily adaptable. :)
 
Back
Top