/* * compute number of all divisors of a number * * 100 has 1,2,4,5,10,20,25,50,100 (9 divisors) */ module example_divisors; var n, i, nof : integer; begin n := 100; i := 1; nof := 0; while i <= n do if n mod i = 0 do nof := nof + 1; end; i := i + 1; end end