tham khảo
https://hoc24.vn/cau-hoi/viet-chuong-trinh-tinh-tong-cac-so-chan-tu-1-toi-n-voi-n-duoc-nhap-tu-ban-phim-bang-vong-lap-whiledo.4935914584802
https://hoc24.vn/cau-hoi/viet-chuong-trinh-tinh-tong-cac-so-chan-tu-1-toi-n-voi-n-duoc-nhap-tu-ban-phim-bang-vong-lap-whiledo.4935914584802
Var i,n,s:integer;
Begin
Write('Nhap n = ');readln(n);
i:=0;
While i <= n do
Begin
If i mod 2 = 0 then s:=s+i;
i:=i+1;
End;
Write('Tong la ',s);
Readln;
End.