/* * compute number of all divisors of a number and * store them in an array. * * 100 has 1,2,4,5,10,20,25,50,100 (9 divisors) */ module example_divisors_array_result; var n, i, nof : integer; divisor : array 20 of integer; begin n := 100; i := 1; nof := 0; while i <= n do if n mod i = 0 do divisor[nof] := i; nof := nof + 1; end; i := i + 1; end end