Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

1. (100 points) (Nested Loops - a for loop inside a while loop) Write a program that reads in a positive integer from the user and outputs a count of...

1. (100 points) (Nested Loops - a for loop inside a while loop)

Write a program that reads in a positive integer from the user and outputs a count of its divisors and whether the input positive integer is a prime number or not. Your program must verify the input is valid. Allow the user to repeat this as many times as they wish (for possibly different inputs). For example, if the user inputs 25, your program must output: 25 has 3 divisors and is not prime If the user inputs 24, your program must output: 24 has 8 divisors and is not prime If the user inputs 13, your program must output: 13 has 2 divisors and is prime Note that 25 has 3 divisors, namely, 1, 5, and 25. 24 has 8 divisors, namely, 1, 2, 3, 4, 6, 8, 12, and 24. 13 has two divisors, namely 1 and 13. Observe that a positive integer is a prime number if it has exactly 2 divisors.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question