plz help me with this ques…
DECIMAL TO OCTAL
what problem you are getting in this question
can you share link of your code ?
how to convert decimal to binary?
or can we directly convert binary to octal? if yes, how?
yes decimal to octal can be done directly
it similar to decimal to binary question
instead of 2 divide with 8
Algorithm :
- Store the remainder when the number is divided by 8 in an array.
- Divide the number by 8 now
- Repeat the above two steps until the number is not equal to 0.
- Print the array in reverse order now.
Reference Code