Question: In the main function, ask the user for a number between 1 - 500 (and check that the number is in this range), then make
In the main function, ask the user for a number between 1 - 500 (and check that the number is in this range), then make a bool that is initialized to false. Send both variables to a void function called mostlyprime and check if the number is divisible by 2, 3, 5, 7, or 11. If it is, output the number and is a false prime and set the bool to true. If it is not, add one to the number and return to the main. In the main, keep running the function until the bool is true. (You must use pass-by-reference for this problem).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
