+ 1
Anyone explain else Loop
I don't know about excution of else Loop https://code.sololearn.com/cUu2pV5EsVC9/?ref=app
7 Réponses
+ 11
example ::: input is 9 , then output will be 1001
If u know how to convert decimal to binary then there must be no problem in understanding this ,
👉U need to think from the opposite side ... not from front side (think backwards 👍)
👉(in java it return integer for integer/integer) ... greatest integer fraction for +ve integers
9%2=1
4%2=0 //4 is 9/2
2%2=0 //2 is 4/2
1%2=1 //1 is 2/2
//9 in binary will be 1001
+ 8
else is not a loop
//it can execute either 1 time ... if condition is true , and if condition is false then statements inside it will not execute
it executes when condition in if() becomes false
//question is unclear , U mean U want to know how to convert decimal to binary or what ?
+ 4
That code is not quite right, try to enter dtob(1024) and see the output. I think you better follow @Gaurav's method.
+ 1
lol. I know I want to know it's excution
0
that's decimal to binary conversion code
0
how's it converting . just explain that program
0
https://code.sololearn.com/cGZQsuV971nG/?ref=app this one is right