Write a static method public static int sumDivisors(int n) that returns the sum of the positive integers less than the parameter n that divide into n…

public static int sumDivisors(int n)that returns the sum of the positive integers less than the parameter n that divide into n exactly (with zero remainder). For example, if n has the value 8, the method returns the value 7 (1 + 2 + 4) and if if n has the value 9, the method returns the value 4 (1 + 3).

Leave a Reply