Advertisement
EWTD

dex to bin

Sep 18th, 2017
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.21 KB | None | 0 0
  1. program lol;
  2. var
  3. a,j:integer;
  4. i:array[0..100] of integer;
  5. begin
  6. j:= 0;
  7. readln(a);
  8. while a > 0 do
  9. begin
  10. i[j]:= a mod 2;
  11. j+= 1;
  12. a:=a div 2;
  13. end;
  14. for j:=j-1 downto 0 do
  15. begin
  16. write(i[j]);
  17. end;
  18. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement