Question: Another Loop and Conditional Execution Exercise

PROBLEM: Do not use the functions nextprime, prevprime, or ithprime in this exercise. Use some kind of do-loop or nested do-loops and conditional statements to compute and display an expression sequence, assigned to the variable P, consisting of the 10 smallest positive prime numbers. This is what I came up with. I reached the value of the counter "n", (for lack of a better name) by trial and error, and that just happened to give me the correct number (10) of primes in the sequence P. > > > This post generated using the online HTML conversion tool Download the original worksheet Please can anyone show me a more efficient solution without so much guesswork involved ? Thanks.
Please Wait...