program konversi_bilangan_desimal_ke_biner1;
uses crt;
var
des,rita :integer;
bin :string;
lagi :char;
begin
repeat
clrscr;
write('masukkan bilangan desimal ='); read(des);
rita :=des;
bin := ' ';
repeat
if (des mod 2 =0) then
bin :='0'+bin
else
bin :='1'+bin;
des :=des div 2;
until des = 0;
writeln('(',rita,')desimal =',bin,'(biner)');
writeln('lagi.......[Y/T]'); lagi :=upcase(readkey);
writeln(lagi);
until lagi <> 'Y';
end.
0 komentar:
Posting Komentar