Question: Need to write a program in C that implements this algorithm. One function should be good but more can be used if needed. Will ask

Need to write a program in C that implements this algorithm. One function should be good but more can be used if needed. Will ask to add short comments in the code in order to understand what is going on in case of any ambiguity.
2.2 Finding Unique Prime Factors This function returns all the prime factors of a given number. One way of doing this is through trial division: 1. Let be the number of which to find the prime factors. 2. Start with 2 as a test divisor 3. If the test divisor squared is greater than the current , then the current is either 1 or prime. Save it if prime and return. 4. If the remainder of divided by the test divisor is zero, then: a. The test divisor is a prime factor of Save it. b. Replace with divided by the test divisor c. Repeat 4b until test divisor is no longer a factor of 5. If, in step 4, the remainder of divided by the test divisor was not zero, then increment the test divisor. 6. Loop to step 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
