Arsip: Aplikasi konversi Biner desimal

 
user image
more 9 years ago

ilhuna

Halo halooo.. ada yang tau gak, membuat aplikasi konversi dari decimal ke binary atau sebaliknya dari binary(biner) ke decimal dengan menggunakan program delphi????????
user image
more 9 years ago

elva_ivana

nih hasil googling .. disni dan disini NB : rajin searching nya
user image
more 9 years ago

aday-gate

nambahin http://fajardelphiscript.blogspot.com/2009/07/konversi-bilangan-dengan-delphi.html nih yang paling bagus
user image
more 9 years ago

reev


procedure TForm5.Button1Click(Sender: TObject);
var
  bin: String;
  intg: Integer;
begin
  intg:=StrToInt(Edit1.Text);
  //convert to bin
  bin:='';
  repeat
    if (intg and 1) = 1 then
      bin:='1'+bin
    else
      bin:='0'+bin;
    intg:= intg shr 1;
  until intg = 0;
  Edit2.Text:=bin;
  //convert back
  intg:=0;
  repeat
    intg:=intg shl 1;
    if bin[1]='0' then
      Intg:=intg or 0
    else
      Intg:=intg or 1;
    delete(bin,1,1);
  until bin = '';
  //result
  Edit3.Text:=IntToStr(intg);
end;
user image
more 9 years ago

reev

Payah geshi, tanda + kok hilang. Nih, yang biasa aja: procedure TForm5.Button1Click(Sender: TObject); var bin: String; intg: Integer; begin intg:=StrToInt(Edit1.Text); //convert to bin bin:=''; repeat if (intg and 1) = 1 then bin:='1'+bin else bin:='0'+bin; intg:= intg shr 1; until intg = 0; Edit2.Text:=bin; //convert back intg:=0; repeat intg:=intg shl 1; if bin[1]='0' then Intg:=intg or 0 else Intg:=intg or 1; delete(bin,1,1); until bin = ''; //result Edit3.Text:=IntToStr(intg); end;
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com