Primality Function Logical Error
A function is designed to determine if a number is prime. Testing shows that it correctly identifies 2, 3, 5, and 7 as prime, but it incorrectly identifies 9 as prime and 11 as not prime. Based on these test results, which of the following statements most likely describes a logical flaw in the function’s algorithm?
A
Only odd divisors greater than 3 are skipped by the function.
B
It returns true if a number is not divisible by 2 or 3 only.
C
The function rejects all numbers above 7 regardless of tests.
D
It does not check divisibility by all possible numbers up to the square root.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | jdvillalta865 | 2 | 2 | 0m 54s | 146 |
| #2 | jasonvikathompson | 1 | 1 | 0m 16s | 84 |
| #3 | djy181023 | 2 | 2 | 3m 26s | -6 |
Items per page:
10
1 – 3 of 3
