Listing.y sebagai berikut :
procedure TForm1.BitBtn1Click(Sender: TObject);
var i : integer;
c : char;
begin
memo1.Clear;
for i := 1 to 10 do
memo1.Lines.Add(IntToStr(i));
for c := 'A' to 'Z' do
Memo1.Lines.Add(c);
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var i : integer;
c : char;
begin
memo1.Clear;
for i := 10 downto 1 do
memo1.Lines.Add(IntToStr(i));
for c := 'Z' downto 'A' do
Memo1.Lines.Add(c);
end;
procedure TForm1.BitBtn3Click(Sender: TObject);
var i : real;
begin
memo1.Clear;
i:=0;
repeat
i:=i+0.5;
memo1.Lines.Add(FloatToStr(i));
until i=10;
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
var i :real;
begin
memo1.Clear;
i:=0;
while i<10 do
begin
i:=i+0.5;
memo1.Lines.Add(FloatToStr(i));
end;
end;
procedure TForm1.BitBtn5Click(Sender: TObject);
var i,j:integer;
begin
memo1.Clear;
for i:=1 to 5 do
begin
j:=0;
while j<5 do
begin
j:=j+1;
memo1.Lines.Add(IntToStr(i)+' X '+IntToStr(j)+' = '+IntToStr(i*j));
end;
memo1.Lines.Add('--------------------');
end;
end;
procedure TForm1.BitBtn6Click(Sender: TObject);
var i:integer;
total:integer;
begin
memo1.Clear;
total:=0;
i:=0;
repeat
i:=i+1;
total:=total+i;
memo1.Lines.Add('Isi I = '+IntToStr(i));
Memo1.Lines.Add('Isi Total = '+IntToStr(total));
until (total>150) or (i>25);
end;
semoga bermanfaat!!! :D
Tidak ada komentar:
Posting Komentar