Bài 1:
Cú pháp: For <biến đếm):=<giá trị đầu>to<giá trị cuối>do<câu lệnh>;
Bài 2:
a)
Program tvnyntg;
Var n: integer;
S: longint;
Begin
Write('Nhap n:'); readln(n);
S:=0;
For i:=1 to n do S:=S+i;
Write('Tong la',S);
Readln
End.
b)
Program giangtri;
Uses crt;
Var n:integer;
N!:longint;
Begin
Write ('Nhap n');
Readln (n);
N!:=1;
For i:=1 to n do N!:=N!*i;
Write ('Tich',N!);
Readln;
End.