Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in C Program #3: Five More Primes, Please Please write a program that will accept an integer from the user, then will immediately print out
in C
Program #3: Five More Primes, Please Please write a program that will accept an integer from the user, then will immediately print out the next five prime numbers equal to or greater than that integer. The program should then ask the user (with a "y" question) whether s/he would like to see another five integers. If so, it should print out the next five prime numbers in sequence, continuing to ask the user after each set whether more are desired. When the user indicates that no more prime numbers are desired, the program should end. You may use a function from a lecture example as part of this program if you would like. Doing so will likely make the program much easier to write. Hint: A do-while loop with another while loop nested inside of it is one possible way to write this progranm. Here is sample output for this program: Where would you like to begin searching for primes?100000 100003 is prime. 100019 is prime. 100043 is prime 100049 is prime. 100057 is prime. Would you like another five? (y)y 100069 is prime. 100103 is prime. 100109 is prime. 100129 is prime. 100151 is prime. Would you like another five? (y)y 100153 is prime. 100169 is prime 100183 is prime. 100189 is prime. 100193 is prime Would you like another five? (y)n Please turn in both your program listing (following all good programming practices we have discussed) and your output. Please clearly indicate them as "Program 3 Code" and "Program 3 OutputStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started