Kamis, 26 April 2012

konversi bilangan desimal ke biner pascal

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

 
Design by Petotu | Bloggerized by Penyejuk Hati - Copaser Mania | Komunitas Blogger Madura