Question: Write a program that ask the user to input a positive number and count the prime numbers before reaching (Exclusive, [1, [) to the user

Write a program that ask the user to input a positive number and count the prime numbers before reaching (Exclusive, [1, [) to the user input. Keep doing that until receive an input 0 from the user.

User input validation

Negative number: you need to ask the user to enter the value again (As shown in the sample output)

0: stop

Remember to reset some values to their original value (e.g., count =0) when suitable.

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!