Question: A positive integer m is called composite if m = ab , where a and b are positive integers such that a ! = 1

A positive integer m is called composite if m = ab, where a and b are positive integers such that a !=1 and b !=1.
If m is composite, then m can be written as a product of prime numbers. Let m be an integer such that 2<= m <=100,000,000. If the integer entered is not within this range, continually prompt the user for an integer until one is provided.
Modify the program in Exercise 21 so that if m is not prime, the program outputs m as a product of prime numbers.
Code from Exercise 21 has been included for you.
Two examples of the program are shown below:
Enter an integer between 2 and 100,000,000: 22222
22222 is not a prime number.
22222=2*41*271
Enter an integer between 2 and 100,000,000: 11
11 is a prime number.

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!