I am using the for loop in this problem, what variable do i use to represent the binary number the user inputs(considering i will have to multiply each digit with a different factor of 2)
How to state the input of a binary number
Hey @crunchybanana
Input it as a string
And
u can use str[i]-‘0’ to convert it to digit before multiplying by 2
I haven’t studied strings yet, should I complete the rest of the course and then attempt these problems?
You know character array ?'if u do then input it as character array
Or array of integers and itterate over it
If u havent studied arrays as well then skip this problem for now 
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.