+ 2

Help needed with hex part in c++

I made the code to accept any binary input to convert to octal and hexadecimal but it seems the hexadecimal outputs 0, But when I comment the octal part out it gives me a correct hexadecimal number. LInk to code: https://code.sololearn.com/c8a6A25a0a15

15th Jul 2021, 11:41 AM
Sire Emmanuelson Yeboah
Sire Emmanuelson Yeboah - avatar
5 odpowiedzi
+ 2
As Jazz said, your problem is with the bn If you add another varible for the second loop it works well https://code.sololearn.com/cnEZIYPAGyN8/?ref=app
15th Jul 2021, 12:12 PM
Brain & Bones
Brain & Bones - avatar
0
Thank you guys
15th Jul 2021, 2:31 PM
Sire Emmanuelson Yeboah
Sire Emmanuelson Yeboah - avatar