Skip to main content

Convert Binary to Octal number

Binary and octal are number systems used to represent numbers in digital electronics and computer programming.

Binary is a base-2 number system, which means it only uses two digits - 0 and 1. Octal is a base-8 number system, which means it uses eight digits - 0, 1, 2, 3, 4, 5, 6, and 7.

Converting a binary number to octal involves grouping the binary digits into sets of three, starting from the rightmost digit, and then replacing each set of three binary digits with its equivalent octal digit.

Here's an example:

Let's say we have the binary number 1011010.

We first group the digits into sets of three, starting from the rightmost digit:

1 011 010

Then, we can replace each set of three binary digits with its equivalent octal digit:

1 3 2

So the octal equivalent of the binary number 1011010 is 132.

Program List





Comment

Please share your knowledge to improve code and content standard. Also submit your doubts, and test case. We improve by your feedback. We will try to resolve your query as soon as possible.

New Comment