Question: Write a C++ function called find_ divisors with the following declaration: Void find_proper_divisors (unsigned long long & number, vector < unsigned long long> &divisors); The

Write a C++ function called find_ divisors with the following declaration:

Void find_proper_divisors (unsigned long long & number, vector< unsigned long long> &divisors);

The function takes a number and replaces the elements of the given vector with all of that numbers proper divisors. A proper divisor of a number n, is an integer less than n that divides n evenly. For example if given the number 12, find_proper_divisors should append 1, 2, 3, 4, and 6 to divisors (use the push_back method in vector). If the given number is less than 2, ignore it. Erase divisors in that case.

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!