Question: please write a code using c++ This exercise queries the user for an integer, x, greater than 1, and returns the product of prime factors
please write a code using c++
This exercise queries the user for an integer, x, greater than 1, and returns the product of prime factors of x. Here is a sample running of the program: Please enter an integer greater than 1 (or any number less than 2 to quit): 100 100 = 2 x 2 x 5 x 5 Please enter an integer greater than 1 (or any number less than 2 to quit): 252 252 = 2 x 2 x 3 x 3 x 7 Please enter an integer greater than 1 (or any number less than 2 to quit): 17 17 = 17 Please enter an integer greater than 1 (or any number less than 2 to quit): 1 Note that your program would need an outer loop to query for an integer until a number less than 2 is entered, which the program would then exit. To check if a is divisible by b, use the modulo operator (%). For example, for any integers a and b greater than 0, a % b == 0 if a divides b evenly. That is, a divided b does not yield any remainder
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
