Primes Up To N Using a Function
PROModular ProgrammingFunctions
Return Values
Write a function `IsPrime(n)` that returns `TRUE` if the integer `n` is a prime number and `FALSE` otherwise. (A prime number is greater than 1 and has no divisors other than 1 and itself.)
Then write a main program that inputs an integer `N`, calls `IsPrime` for every whole number from 2 to `N` inclusive and outputs each prime number on its own line.
If there are no primes in that range, output `None`.
For example, if `N` is 10 the output is 2, 3, 5, 7 (one per line).
Example Input
10
Example Output
2
3
5
7
0% (0 passed / 0 attempted)