its a program that should list the first 1000 prime numbers, but it dsntmy (@primes, $i); for(@primes=(2), $i=3 ;scalar(@primes) < 1000 ;$i++) {foreach my $p (@primes){ if ($i % $p == 0){ $i++ } } push @primes, $i; } print ("@primes");
In reply to Prime list by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |