QP School

Full Version: Basic algorithms and Data Structures in Object Pascal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
program BasicAlgorithmsExample;
const
  SIZE = 5;

var
  numbers: array[0..SIZE - 1] of Integer;
  i: Integer;
begin
  // Populate the array with values
  for i := 0 to SIZE - 1 do
    numbers[i] := i + 1;

  // Output the array elements
  for i := 0 to SIZE - 1 do
    WriteLn('Number ', i + 1, ': ', numbers[i]);
end.