home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / modula2 / alexcoco / test.tas < prev   
Text File  |  1987-04-14  |  415b  |  22 lines

  1. { This is a test program which can be compiled by the Taste-compiler.
  2.   It asks for a number and computes the sum of all integers up to this number.}
  3.  
  4. PROGRAM Test;
  5. VAR i: INTEGER;
  6.   
  7.   PROCEDURE SumUp;
  8.   VAR sum: INTEGER;
  9.   BEGIN
  10.     sum:=0;
  11.     WHILE i>0 DO sum:=sum+i; i:=i-1 END;
  12.     WRITE sum;
  13.     END SumUp;
  14.     
  15. BEGIN
  16.   READ i;
  17.   WHILE i>0 DO
  18.     SumUp;
  19.     READ i 
  20.     END
  21.   END Test.
  22.