Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Main()
- dim denary As integer
- dim binary As string
- dim PowerTwo As integer
- console.writeline(" enter your number")
- denary=console.readkey
- do until powerTwo > denary
- powerTwo = powerTwo * 2
- loop
- powerTwo = powerTwo / 2
- do until denary= 0
- if powerTwo > denary Then
- binary = binary & "1"
- powerTwo = PowerTwo / 2
- else
- binary = binary & "0"
- powerTwo = PowerTwo / 2
- EndIf
- loop
- console.writeline("your result is" & binary)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement