Question: c++ Request an integer from the console. If the number is a prime number, output that it is prime. If the number is not a

c++
Request an integer from the console.
If the number is a prime number, output that it is prime.
If the number is not a prime number, output all factors between 1 and n.
A prime number is only divisible by 1 and itself.
Example 1 Output (input in bold italics)
Enter an integer: 19
19 is prime.
Example 2 Output (input in bold italics)
Enter an integer: 24
2 is a factor of 24
3 is a factor of 24
4 is a factor of 24
6 is a factor of 24
8 is a factor of 24

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!