Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uses crt;
- procedure solve();
- var
- bin:array[1..100] of longint;
- n,d:longint;
- begin
- write('dec: '); readln(d);
- n:=0;
- repeat
- begin
- inc(n);
- bin[n]:=d mod 2;
- d:=d div 2;
- end;
- until d=0;
- write('bin: ');
- for n:=n downto 1 do write(bin[n]);
- end;
- begin
- clrscr();
- solve();
- readln();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement