Question: I must create a Loop in C++ that will print all prime numbers less than the number entertered by the user. 1. Accept the upper
I must create a Loop in C++ that will print all prime numbers less than the number entertered by the user.
1. Accept the upper limit from the user (as an integer). (5 points) 2. Make sure the number is positive. If it is not, terminate the program. (5 points). 3. Go from 1 to the number. If you happen to find a number that is prime, print it. (35 points)
example:
Enter the upper limit: 25 The prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
