Oh yes, it's incorrect.

This is your homework, so no code!

But...think about it. What is Octal? What are Octal numbers?

The answer is: base 8. Octal numbers contain only the digits '0' to '7' inclusive, in the same way that Decimal (base 10) contains only the digits '0' to '9' inclusive, and Binary (Base 2) contains only the digits '0' and '1'.

Your code doesn't even try to use Octal...

I'd strongly suggest that you invest some time in working out how to use the debugger - Google will help you there, just google 'C', the name of the C IDE you are using, and "Debugger" and it should give you an explanation. It will save you a lot of hair pulling when you get to this stage!

14,485,484 members

Is it, for instance 00100111->047?

Note: binary and octal are just number representations (that is a string should be expected by the user).