Printing the prime factorization of a given number
How do we write a program to find the prime factorization of a given number? For example prime factorization for 18 can written as 2 * 3 * 3 or 2 * 3 ^ 2. For any number there is only one possible prime factorization. An efficient algorithm can be given as follows. we run…