Write VB program to find octal , hexadecimal , binary of given decimal number.

Write VB program to find octal , hexadecimal , binary of given decimal number.

Private Sub OptBin_Click()

Dim N As Single

Text2.Text = ""

N = Text1.Text

While N > 0

R = N Mod 2

Text2.Text = Text2.Text & R

N = Int(N / 2)

Wend

Text2.Text = StrReverse(Text2)

End Sub

Private Sub Form_Load()

Text1 = ""

End Sub

Private Sub OptHexa_Click()

Text2.Text = Hex(Text1.Text)

End Sub

Private Sub OptOctal_Click()

Text2.Text = Oct(Text1.Text)

End Sub


Comments