Finding Primes
- Prompt the user about the purpose of the program. And ask the user for input n.
- Run a loop from 2 to n to try each number p as a candidate for prime.
- Run inside the first loop a second loop to see if p can be divided exactly by d for d = 2, 3, …, p-1.
-
- A prime is the one which can not be divided by any of the d. Print the prime.