For..
Do Loop
Statement of the Problem:
1. Create an application that will display the next 10 numbers when a
number is inputted.
Output:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var ctr:integer;
x:real;
begin
x:=strtofloat([Link]);
[Link];
for ctr:=1 to 10 do
[Link](floattostr(x+ctr));
end;
end.
Statement of the Problem:
2. Create a program that will display starting from 1 up to the inputted
number.
Output:
Code:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
[Link](num);
var x,ctr:integer; end;
num:string; end;
end;
begin end.
if key=VK_return then
begin
x:=strtoint([Link]);
[Link];
num:='';
for ctr:=1 to x do
begin
num:=num+inttostr(ctr);
Statement of the Problem:
3. Create an application 1 up to 180 that will display the word “A dozen
has passed every time a dozen of numbers will pass.
Output:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var ctr,m,x:integer;
begin if m=0 then
[Link]; [Link]('A dozen has
for ctr:=1 to 80 do passed');
begin end;
[Link](inttostr(ctr)); end;
m:=ctr mod 12; end.