10 input "Primes to": i% wall = time(0%) cpu = time(1%) dim numbers% (i%) prime% = 0% not_prime% = 1% numbers%(1%) = not_prime% step% = 1% for i% = 1% to sqr(size(numbers%)) if numbers%(i%) = prime% then for j% = i%+i%*step% to size(numbers%) step i%*step% numbers%(j%) = not_prime% next j% step% = 2% end if next i% wall1 = time(0%) - wall cpu1 = (time(1%) - cpu) / 10. primes% = 0% form$ = '########' for i% = 1% to size(numbers%) if numbers%(i%) = prime% then primes% = primes% + 1% print using form$: i%; end if next i% print print wall2 = time(0%) - wall - wall1 cpu2 = (time(1%) - cpu) / 10. - cpu1 print 'There are'; primes%; 'primes less than'; size(numbers%) print 'Calculated in'; cpu1; 'CPU seconds and'; wall1; 'wall seconds' print 'Printed in'; cpu2; 'CPU seconds and'; wall2; 'wall seconds'