Converting Between Decimal, Octal, and Binary Numbers (31789)
The information in this article applies to:
- Microsoft Visual Basic for MS-DOS
- Microsoft Visual Basic Standard Edition for Windows 1.0
- Microsoft Visual Basic Standard Edition for Windows 2.0
- Microsoft Visual Basic Standard Edition for Windows 3.0
- Microsoft Visual Basic Professional Edition for Windows 2.0
- Microsoft Visual Basic Professional Edition for Windows 3.0
- Microsoft BASIC Compiler, when used with:
- the operating system: Mac OS (all versions)
- Microsoft BASIC Interpreter for Apple Macintosh 1.0
- Microsoft BASIC Interpreter for Apple Macintosh 1.01
- Microsoft BASIC Interpreter for Apple Macintosh 2.0
- Microsoft BASIC Interpreter for Apple Macintosh 2.1
- Microsoft BASIC Interpreter for Apple Macintosh 3.0
- Microsoft QuickBASIC 1.0
- Microsoft QuickBASIC 1.01
- Microsoft QuickBASIC 1.02
- Microsoft QuickBASIC 2.0
- Microsoft QuickBASIC 2.01
- Microsoft QuickBASIC 3.0
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
- Microsoft GW-Basic Interpreter 3.20
This article was previously published under Q31789 SUMMARY
The Microsoft Basic code below demonstrates how to perform the
following conversions between decimal, octal, and binary numbers:
- Convert an octal number to a decimal (base 10) number
- Convert a decimal number to an octal (base 8) number
- Convert a decimal number to a binary (base 2) number
Modification Type: | Minor | Last Reviewed: | 8/16/2005 |
---|
Keywords: | KB31789 |
---|
|