home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / PASSRC.ZIP / WHILELP.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-04  |  919b  |  31 lines

  1.                                 (* Chapter 4 - Program 7 *)
  2. program While_Loop_Example;
  3.  
  4. var Counter : integer;
  5.  
  6. begin
  7.    Counter := 4;
  8.    while Counter < 20 do begin
  9.       Write('In the while loop, waiting ');
  10.       Write('for the counter to reach 20. It is',Counter:4);
  11.       Writeln;
  12.       Counter := Counter + 2;
  13.    end;
  14. end.
  15.  
  16.  
  17.  
  18.  
  19. { Result of execution
  20.  
  21. In the while loop, waiting for the counter to reach 20. It is   4
  22. In the while loop, waiting for the counter to reach 20. It is   6
  23. In the while loop, waiting for the counter to reach 20. It is   8
  24. In the while loop, waiting for the counter to reach 20. It is  10
  25. In the while loop, waiting for the counter to reach 20. It is  12
  26. In the while loop, waiting for the counter to reach 20. It is  14
  27. In the while loop, waiting for the counter to reach 20. It is  16
  28. In the while loop, waiting for the counter to reach 20. It is  18
  29.  
  30. }
  31.