subject

Write a program that prompts the user to enter in a positive number. Only accept positive numbers - if the user supplies a negative number or zero you should re-prompt them. Next, determine if the given number is a prime number. A prime number is a number that has no positive divisors other than 1 and itself. For example, 5 is prime because the only numbers that evenly divide into 5 are 1 and 5. 6, however, is not prime because 1, 2, 3 and 6 are all divisors of 6.
Here's a sample running of the program:
Enter a positive number to test: 5
2 is NOT a divisor of 5...
3 is NOT a divisor of 5...
4 is NOT a divisor of 5...
5 is a prime number!
And here's another running:
Enter a positive number to test: 9
2 is NOT a divisor of 9...
3 is a divisor of 9...
9 is NOT a prime number.
Some notes on your program:
1 is technically not a prime number.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:50
Using the artofstat website, run a permutation test to see if there is a difference in the mean amount of time spent on emails per day between in state and out of state students. (make sure to generate 10,000 permutations.) in state students: 2 3 3 6 2 1 1 5 3 2.5 out of state students: 1 2 2 1 2 1 4 3 9 1 10 1 3 what is the p-value?
Answers: 3
question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
You know the right answer?
Write a program that prompts the user to enter in a positive number. Only accept positive numbers -...
Questions
question
Mathematics, 08.04.2021 06:10
question
Chemistry, 08.04.2021 06:10
question
Mathematics, 08.04.2021 06:10
Questions on the website: 13722367