(*            Teresa Tong  F.4AS 30     Noverber,2001            *)
(* using for loop to print out the number series 100 98 ...2 and sum
   up all the numbers *)

program sum_nos_for;
uses wincrt;
var N:integer;
    sum:longint;
begin
  sum:= 0;
  N:= N-2;
  for N:= 100 downto 2 do
  if N mod 2 = 0
  then
    begin
    write(N, ' ');
    sum:= sum+N;
    end;
  writeln;
  writeln( 'the sum is = ', sum )
end.


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
e.g.

100 98 96 94 92 90 88 86 84 82 80 78 76 74 72 70 68 66 64 62 60 58 56
54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 20 18 16 14 12 10 8 6
4 2
the sum is = 2550

    Source: geocities.com/ttt_7_ttt/home6

               ( geocities.com/ttt_7_ttt)