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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!