0

Created Decimal to Binary conveter but still not works.

I took 30 minutes to make this converter but only gives right output of sum decimal numbers only like 13 29 and more. But it also gives wrong output of many numbers like 2, 32 etc. Any help? https://code.sololearn.com/cgPCfBms8GfU/?ref=app https://code.sololearn.com/cgPCfBms8GfU/?ref=app

13th May 2019, 9:17 PM
Robin Singh
Robin Singh - avatar
2 Answers
0
Are all of your working examples odd numbers? If so, it may be an issue related to that Edit: I think your code is just not displaying correctly: for example the digit 4 in binary should be 00000100 but just displays 1. is your code stripping away the 0s?
17th May 2019, 4:14 PM
Will01
Will01 - avatar
0
Will01 I think they are.
17th May 2019, 4:18 PM
Robin Singh
Robin Singh - avatar