Pwede naman.. divide by 2 then if may remainder ka labas niyan is 1 pag wala then 0..
let y be the decimal value
let x be the result
example: y=10
formula = 10/2 = 5 then x = 0
formula = 5/2 = 2.5 then x = 1
formula = 2/2 = 1 then x = 0
formula = 1/2 = 0.5 then x= 1
padaanin mo sa loop yung value ng x w/c is yung result ng formula mo...
heto magiging output: 00001010
pseudocode:
if len(x) <> 8 then dagdag ka ng zero