Write a program which will read an integer value (greater than 2) from the keybo
ID: 3640159 • Letter: W
Question
Write a program which will read an integer value (greater than 2) from the keyboard, determine if that number is prime, and display the result.
Example run:
Welcome to Rickster's wiz-bang prime number thing!
Enter an integer greater than 2: 35
35 is divisible by 5, so it is not prime.
and also
Have your program process multiple user inputs, with the user entering 0 to quit.
Example run:
Welcome to Rickster's wiz-bang prime number thing!
Enter an integer greater than 2 (0 to quit): 35
35 is not prime.
Enter an integer greater than 2 (0 to quit): 13
13 is prime.
Enter an integer greater than 2 (0 to quit): 0
Thanks for playing.
Explanation / Answer
PS: Please rate the answer #include #include using namespace std; int check_prime(int n) { for (int i = 2; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.