Requested

Write a program that displays the prime numbers below a given number in lines, each of which contains 10 numbers. An integer greater than 1 is prime if its only positive divisor is 1 or itself. For example, 2, 3, 5, and 7 are prime numbers, but 4, 6, 8, and 9 are not.

Examples

Below are some sample executions of the assignment. The text in red represents user input and will logically not be printed by your program.

Example

Find all prime numbers <= n, enter n:
50
The prime numbers are:
 2 3 5 7 11 13 17 19 23 29
 31 37 41 43 47
15 prime(s) less than or equal to 50