uses wincrt;
var
x,sisa,y:integer;
hasil:string;
begin
write('Masukan Bilangan Bulat= ');
readln(y);
hasil:='';
x:=y;
repeat
sisa:= x mod 2;
x:= x div 2;
case (sisa) of
0: hasil:='0' + hasil;
1: hasil:='1' + hasil;
end;
until (x=0) ;
gotoxy(5,3);
writeln(y,' Bil biner = ',hasil);
end.
Preview :
0 comments :
Posting Komentar