Welcome to collectivesolver - Programming & Software Q&A with Examples. A website you can trust. All programs tested and work.

Contact: aviboots(AT)netvision.net.il


Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Dental Dog Chews
FRESH BREATHIES

GlucoTrust is a brand new, science-backed supplement that supports healthy blood sugar levels AND weight loss for men and women

Everything you need to sell anywhere

Managed VPS Hosting
Affordable. Secure. Your Own Virtual Private Hosting. Faster than AWS and Rackspace

Bonsai Boy of New York Bonsai Trees and Accessories
100%

Disclosure We are a professional Programming & Software Q&A website, that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

24,887 questions

32,502 answers

573 users

How to convert octal to binary in VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim decimal_number As Integer = 0, oct As Integer = 23
        Dim _base As Integer = 1, tmp As Integer = oct

        While tmp > 0
            Dim last_digit As Integer = tmp Mod 10
			tmp = tmp / 10
            decimal_number += last_digit * _base
			_base = _base * 8
        End While

        Dim mulby10 As Integer = 1, binary_number As Integer = 0
		Dim i As Integer = decimal_number

    	While i > 0
			binary_number = binary_number + (decimal_number Mod 2) * mulby10
            mulby10 = mulby10 * 10
            decimal_number = decimal_number \ 2
			i = i \ 2
    	End While

        Console.Write(binary_number)
    End Sub
End Class





' run:
'
' 10011
'

 




answered Jul 24 by avibootz
...