Cách 1: dùng for ... do
program tinhtich;
uses crt;
var tich:longint;
i:byte;
begin
clrscr;
tich:=1;
for i:=1 to 10 do
tich:=tich*i;
write('Tich 10 so tu nhien dau tien la: ',tich);
readln
end.
Cách 2: dùng while ... do
program tinhtich;
uses crt;
var i:byte;
tich:longint;
begin
clrscr;
i:=1; tich:=1;
while i<=10 do
begin
tich:=tich*i;
i:=i+1;
end;
write('Tich 10 so tu nhien dau tien la: ',tich);
readln
end.