0
I did the conversion with recursion 😃😁.. But i have this doubt 👇
https://code.sololearn.com/c9TA1q1i0LeT/?ref=app I did the conversion with recursion 😃😁.. But i have this doubt 👇 In case if decimal is 8 , the binary will be 0+(0*10)+(0*10)+(1*10) is 1000 instead of 10, why is that? Also tell me how can i furthur optimize this program
3 Antworten
+ 16
Continuing the msg of Kira...
And read the Soln from LSB(least significant bit)
+ 1
Thats not how you do decimal to binary conversion.
You have to divide the number with the base 2(for binary) and note down the remainder in every step.
Binary of 8 is 1000 not 10
0
Hey kiRA
But the code is working. input 8 gives output 1000.
I just can't understand the calculation done there.