Câu lệnh for ... do
program Tinh_Tich;
var
n, i: integer;
S: double;
begin
write('Nhap vao so nguyen N: ');
readln(n);
S := 1;
for i := 7 to n do
begin
S := S * i * i * i;
end;
writeln('Tich cac so 7^3*8^3*9^3*...*N^3 la: ', S);
readln;
end.
Câu lệnh while .... do
program Tinh_Tich;
var
n, i: integer;
S: double;
begin
write('Nhap vao so nguyen N: ');
readln(n);
S := 1;
i := 7;
while (i <= n) do
begin
S := S * i * i * i;
i := i + 1;
end;
writeln('Tich cac so 7^3*8^3*9^3*...*N^3 la: ', S);
readln;
end.