Why is the output 4 ???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
20th May 2018, 2:17 AM
Mohammad Nabavi
Mohammad Nabavi - avatar
3 Answers
+ 6
Mohammad Nabavi You're welcome! 😉
20th May 2018, 5:08 AM
Zephyr Koo
Zephyr Koo - avatar
+ 6
The integer getting parsed was treated as base 2 and here's how we count in binary:- 0 1 10 11 100 <- 4 101 110 111 ...
20th May 2018, 2:24 AM
Zephyr Koo
Zephyr Koo - avatar
+ 5
thank😉
20th May 2018, 2:26 AM
Mohammad Nabavi
Mohammad Nabavi - avatar