educative.io

Why do you add a 0 before the binary value of num1=10?

The binary value of 10 is 1010. In the example, it says the binary value of num1 = 10 is 01010. Why do you add a zero before 1010? Thank you for explaining.

Hi @Anri_Wu,

I have checked both courses of Data Structures in Java and Python, the question of generating binary number from 1 to n, is not adding any 0. Please check again and kindly mention the exact course and it’s exact lesson. Thank you.