count prime: b. Write a function is_prime() which determines if a number is prime. The function has one integer parameter. The function returns true if the input parameter is prime and false otherwise.A number a is prime if and only if (a mod b ≠ 0) for b = 2, 3, ..., (a − 1) // FUNCTION PROTOTYPE FOR is_prime // DEFINE FUNCTION is_prime() HERE:
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
23 | 24 | 25 | 26 | 27 | 28 | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | 1 | 2 | 3 | 4 | 5 |
Get Free Quote!
383 Experts Online