Tham khảo:
Program BTH;
uses crt;
var i,n,s:longint;
Begin
clrscr;
write('Nhap n: ');readln(n);
i:=1;
While i<>n do
Begin
If i mod 2=0 then s:=s+i;
i:=i+1;
end;
writeln('Tong day so tren la: ',s);
readln;
end.