a, Có tất cả $\text{4}$ vòng lặp.
Khi chương trình kết thúc, $\text{x:=8; T:=20;}$
b, Chương trình
$\text{program hagiakhanh;}$
$\text{uses crt;}$
$\text{var x, T: integer;}$
$\text{begin}$
$\text{clrscr;}$
$\text{while T<15 do begin x:=x+2; T:=T+x; end;}$
$\text{writeln('T = ',T);}$
$\text{readln}$
$\text{end.}$