The program to convert a number from octal to binary is discussed here. Firstly, the given octal number is converted to a decimal number. Then, the decimal number is converted to binary.
For example, consider the octal number 17 which has to be converted to binary.nnThe decimal equivalent of the octal number 17 is calculated as followsnn7 * 8^0 = 7n1 * 8^1 = 8nnDecimal equivalent : 15 (8 + 7)nnNow, this 15 is converted to binarynn15 / 2 = 7 , rem = 1n7 / 2 = 3 , rem = 1n3 / 2 = 1 , rem = 1n1 / 2 = 0 , rem = 1nnBinary Equivalent : 1111n
Firstly, convert the number from octal to decimal.
Then, convert the decimal number to binary,
@@coding::1@@
Time complexity:O(n)
Recommended Programs