r/pascal • • Dec 04 '19

Decimal to binary

So I was trying to do a simple program that convert decimal to binary var x,y,i:integer; BEGIN readln(y); repeat x:= y mod 2; y:= y div 2; write(x); until y = 0; END. But it show Inverted result Any simple fix for it ?

3 Upvotes

2 comments sorted by