Question: Exercise 4: Prime factors Implement a function that takes an integer as its sole argument and returns a vector containing the prime factors of that

Exercise 4: Prime factors

Implement a function that takes an integer as its sole argument and returns a vector containing the prime factors of that number. For example, if you pass in 100, then function returns the vector (2, 2, 5, 5). The function signature should look like the following.

vector factor(int n)

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!