About Us | Contact | Disclaimer | Privacy Policy | Sitemap

Delphi Perulangan


BUat  yang masi belajar dasar delphi..Nih Ada Program dasarnya..Buat kalian semua.. Yang Cinta ama program.. & materi Ini ., Penting Buat Bikin Program Yang Handal...Tpi ya.. Semua Itu Butuh Proses..OK..:D

Langsung Aja Ke TKP deh....

Button For_To_Do

procedure TForm1.Button1Click(Sender: TObject);
Var
      a1,a2 :Integer;

begin
a2 := 10;

for a1 := 1 to a2 do
edit1.Text := edit1.Text +' '+ IntToStr(a1);


end;



___________________________________________________________
Button For_Down_To

procedure TForm1.Button2Click(Sender: TObject);
var
      a1,a2 :Integer;

begin
a2 := 1;
for a1 := 10 downto a2 do
edit2.Text := edit2.Text +' '+IntToStr(a1);

end;



____________________________________________________________
Button While_Do

procedure TForm1.Button3Click(Sender: TObject);
var

      a1,a2 : integer;

begin
a1 := 1;
a2 := 10;
while a1<=a2 do
begin
edit3.Text := edit3.Text+' '+IntToStr(a1);
a1 := a1 + 1;
end;
end;
_________________________________________________________

Button Repeat_Until

procedure TForm1.Button4Click(Sender: TObject);
var
    a1,a2 :integer;

begin
a1 := 1;
a2 := 11;
repeat
edit4.Text := edit4.Text+' '+IntToStr(a1);
a1 := a1 + 1;
until a1=a2;

end;

_________________________________________________________

Button Vaktorial


procedure TForm1.Button5Click(Sender: TObject);
var

        a1,a2,vak : integer;

begin
a1 := 1;
a2 := StrToInt(edit6.text);
vak := 1;
for a1 := 1 to a2 do
begin
    vak := vak*a1;
    end;
    edit5.Text := IntToStr(vak);

end;

end.

________________________________________________________

HMMmmm... Yah Gitu aja Program..Nya..Tinggal anda2 lah yang mengembangkan Program..semau anda smua..,, & yang penting kreatif ..