(*Cathy Ngai F.4AS(24) *)
(*the purpose of this program is to print out the number series 100 98 ...2 and to sum up all the numbers by using whileloop *)

program whileloopSumUpNumbers;
uses wincrt;
var C : integer;
    sum : longint;
begin
  C:= 100;
  while C >= 2 do
  begin
    write(C, ' ');
    sum:= sum+C;
    C:= C-2
    end;
  writeln;
  writeln( 'the sum is = ', sum )
end.

******************************************************************
output 1
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/hk/cathy_740

               ( geocities.com/hk)