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, 22.06.2019 08:30
1.the index finger on your right hand types the f r v 4 j u m 7 h y 6 n lo.9 j u 7 m g t 5 b 2.if you need to multiply 400, 2, and 1 ½, what would you type on the numeric keypad? 400*2*1.5 400/2*1.5 400/2/1.5 400*2*1½ 3.select all examples of proper keyboarding technique. rest your fingers gently on the home row or home keys. slouch in your chair. rest your palms on the keyboard. relax your fingers. keep your hands lower than your elbows.
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
The qwerty keyboard is the most common layout of keys on a keyboard
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
Write a program that prints the day number of the year, given the date in the form month-day-year. for example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006, the day number is 359. the program should check for a leap year. a year is a leap year if it is divisible by 4, but not divisible by 100. for example, 1992 and 2008 are divisible by 4, but not by 100. a year that is divisible by 100 is a leap year if it is also divisible by 400. for example, 1600 and 2000 are divisible by 400. however, 1800 is not a leap year because 1800 is not divisible by 400.
Answers: 3
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
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, 10.07.2019 13:30
question
Social Studies, 10.07.2019 13:30
question
Mathematics, 10.07.2019 13:30
Questions on the website: 13722361