![]() |
VOOZH | about |
The octal numbers are a base 8 number system that uses digits from 0-7 and the decimal numbers are a base 10 numbers system that uses 10 digits from 0-9 to represent any numeric value.
In this article, we will learn how to write a C++ program to convert a given decimal number into an equivalent octal number. i.e. convert the number with base value 10 to base value 8.
The below diagram shows an example of converting the decimal number 33 to an equivalent octal number.
👁 decimal to octal conversion in C++41
If the given decimal number is 33.
Stop repeating steps and print the array in reverse order. Therefore, the equivalent octal number is 41.
Refer to the complete article Program for Decimal to Octal Conversion for more methods to convert Decimal numbers to Octal numbers.