Örnek-1
program Tek_1;
uses crt;
var
i, sakla : integer;
begin
clrscr;
for i := 3 to 27 do
begin
if i mod 2 = 1 then
sakla := sakla + i
end;
write(sakla);
readln
end.
Örnek-2
program Tek_2;
uses crt;
var
i, j, sakla : integer;
begin
clrscr;
for i := 3 to 27 do
begin
if (i/2) <> int(i/2) then
sakla := sakla + i;
end;
write(sakla);
readln
end.
Örnek-3
program Tek_3;
uses crt;
var
i, sakla : integer;
begin
clrscr;
for i := 3 to 27 do
begin
sakla := sakla + i;
if i < 27 then
i := i + 1
end;
write(sakla);
readln
end.
Örnek-4
program Tek_4;
uses crt;
var
i, j, sakla : integer;
begin
clrscr;
j := 3;
for i := 3 to 27 do
begin
if i = j then
begin
sakla := sakla + i;
j := j + 2
end;
end;
write(sakla);
readln
end.
Örnek-5
program Tek_5;
uses crt;
var
i, j, sakla : integer;
S : string[20];
begin
clrscr;
for i := 3 to 27 do
begin
j := i;
Str(j,S);
S := copy(S,length(S),1);
val(S,j,j);
if j in [1,3,5,7,9] then
sakla := sakla + i;
end;
write(sakla);
readln
end.