Question: Im trying to write a program in C++ I know I would need one loop to check if a number is prime or not. And

Im trying to write a program in C++  Im trying to write a program in C++ I know I
I know I would need one loop to check if a number is prime or not. And then another loop that increments to the next number. This will repeat until the outer loop reaches an integer n that the user inputs.

Create a program that takes an int from the user and tells the user what the largest prime number less than or equal to that value is. Repeat this program until they want to quit. Quitting is indicated by a y' at the prompt Input an integer: 8 7 is the largest prime

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!