I. Trắc nghiệm:
1. C
2. B
3. A
4.
5. C
II. Thực hành:
1. Dùng For ... do ...
Program FNG;
Uses crt;
Var n,i,s: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
For i:=1 to n do
s:=s+i;
Write('S = ',s);
Readln
End.
2. Dùng While ... do ...
Program FNG;
Uses crt;
Var n,i,s: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
i:=1;
While i<=n do
Begin
s:=s+i;
inc(i);
End;
Write('S = ',s);
Readln
End.