Question: Use C++ to implement the following program about Prime Factorization of a Number . Do BOTH parts of the problem or you will lose points.

Use C++ to implement the following program about Prime Factorization of a Number. Do BOTH parts of the problem or you will lose points. Provide comments to explain each step.

a. Write a function that takes as a parameter a positive integer and returns a list (array) of the prime factors of the given integer. For example, if the parameter is 20, you should return 2 2 5.

b. Write a function that tests the above function by asking the user for input and displaying the output to screen. Your function should display the following menu:

1) Find the prime factorization of a number.

2) Quit.

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!