<Test Failed condition>my $input = $ARGV[0]; my $flag = 0; my $i; for ($i=2; $i < $input ; $i++) { if ($input % $i == 0) { $flag = 1; last; } } if ($flag == 0) { print "$input is prime.\n"; exit; } print "$input is not prime and divisible by $i.\n";
In reply to is_a_prime test? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |