+ 2
13 : 2 = 6 R 1 6 : 2 = 3 R 0 3 : 2 = 1 R 1 1 : 2 = 0 R 1 1101
8th Nov 2022, 6:40 AM
Oma Falk
Oma Falk - avatar
+ 1
Without array you can use stack frames to store partial results. I.e. think recursion. Symbolically d2b(n) ≡ d2b(n>>1) + n&1 where d2b is a function converting decimal 2 binary.
8th Nov 2022, 7:26 AM
Ani Jona 🕊
Ani Jona 🕊 - avatar