Question: Modify the program below so that it uses a non-recursive solution. You will end up having to write more code. (Hint: To make the job

Modify the program below so that it uses a non-recursive solution. You will end up having to write more code. (Hint: To make the job easier, write two functions: get all divisors and get lowest divisor. The main function should call get all divisors, which in turn has a loop: get all divisors calls get lowest divisor repeatedly, each time replacing n with n/i, where i is the divisor that was found. If n itself is returned, then the number is prime, and the loop should stop. PrimeFactorizationRecursive.cpp #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
