Question: C++ language Write a function that computes the sum of an integer, non-zero, number's positive divisors. The function has one parameter, the integer number and

C++ language Write a function that computes the sum of an integer, non-zero, number's positive divisors. The function has one parameter, the integer number and returns one value, the integer sum. A number's divisors divide the number with remainder zero

if the function's parameter is 6 then the function returns 12 because 6's positive divisors are 1,2,3 and 6.

If the function's parameter is -5 then the function returns 6 because -5 's positive divisors are 1 and 5.

If the function's parameter is 5 then the function return 6 because 5's positive divisors are 1 and 5.

If the function's parameter is 28 then the function returns 56 because 28's positive divisors are 1, 2, 4, 7,14, and 28.

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!