Challenge 22

🌟

Is Prime?

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

Create a function which takes in a number as a parameter and returns whether it is a prime number

Examples:

isPrime(7) returns true

isPrime(8) returns false

Extension:

Output the first 1000 prime numbers. Do you notice any loose general patterns?

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618