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

  1.                                 (* Chapter 6 - Program 1 *)
  2. program Simple_Arrays;
  3.  
  4. var Count,Index : integer;
  5.     Automobiles : array[1..12] of integer;
  6.  
  7. begin
  8.    for Index := 1 to 12 do
  9.       Automobiles[Index] := Index + 10;
  10.    Writeln('This is the first program with an array');
  11.    Writeln;
  12.    for Index := 1 to 12 do
  13.       Writeln('automobile number',Index:3,' has the value',
  14.                                         Automobiles[Index]:4);
  15.    Writeln;
  16.    Writeln('End of program');
  17. end.
  18.  
  19.  
  20.  
  21.  
  22. { Result of execution
  23.  
  24. This is the first program with an array
  25.  
  26. automobile number  1 has the value  11
  27. automobile number  2 has the value  12
  28. automobile number  3 has the value  13
  29. automobile number  4 has the value  14
  30. automobile number  5 has the value  15
  31. automobile number  6 has the value  16
  32. automobile number  7 has the value  17
  33. automobile number  8 has the value  18
  34. automobile number  9 has the value  19
  35. automobile number 10 has the value  20
  36. automobile number 11 has the value  21
  37. automobile number 12 has the value  22
  38.  
  39. End of program
  40.  
  41. }