lundi 7 mai 2018

How to convert a decimal to octal in c++?

How do I convert a decimal to binary and then octal?

Example my decimal number is 42.

I know that I have to mod it to either give 0 or 1 to convert it to binary. How do I do this and how do I read the binary number?

After I got the binary I convert it to octal. How do I do this? I know in theory how to do this,but I don't know how to do it in c++ coding.

Aucun commentaire:

Enregistrer un commentaire