Convert Binary To Octal

Write a program to convert binary to octal

Binary is a base-2 number system. It uses only two digits: 0 and 1. The digits are called bits. A bit is the smallest unit of information in a computer. A bit can be either 0 or 1. A bit can be used to represent a single value, such as 0 or 1, or it can be used to represent a single state, such as on or off.

Octal is a base-8 number system. It uses only eight digits: 0, 1, 2, 3, 4, 5, 6, and 7. The digits are called octits. An octit is the smallest unit of information in a computer. An octit can be used to represent a single value, such as 0, 1, 2, 3, 4, 5, 6, or 7, or it can be used to represent a single state, such as on or off.

To convert a binary number to octal, we can use the following algorithm:

  1. Convert the binary number to decimal.
  2. Convert the decimal number to octal.
Input : 1010 Output : 12

Contributors

This program is made possible by the following contributors:

bulutg
MadhuS-1605
anandfresh
AshitaSingamsetty
harshraj8843
RiteshK-611
AdityaNarayanPradhan
roshan798
pokharel-nishan
joao-vitor-souza
greeshma-d
vishal2376
iresh96

Heart with ribbonBecome a SponsorHeart with ribbon

Become a sponsor and help us maintain and improve this project. Every contribution counts. Thank you!