C Program to Convert Binary Numbers to Octal and vice-versa

In this example, you will learn to convert binary numbers to octal and octal numbers to binary manually by creating a user-defined function.

Example 1: Program to Convert Binary to Octal

In this program, we will first convert binary numbers to decimals. Then, the decimal number is converted to an octal.