The Abundant Number

MediumAcc. 94.2%
+20 XP 8

Overwhelming Factors

An Abundant Number is a number where the sum of its proper divisors is greater than the number itself. Example: 12 (Divisors 1, 2, 3, 4, 6 $ o$ sum = 16. $16 > 12$, so it is abundant).

The Assignment

Your function receives a parameter num.

  1. Calculate the sum of proper divisors (using a loop).
  2. If the sum is greater than num, print "true", otherwise "false".

01EXAMPLE 1

Inputnum=12
Outputtrue

Explanation: Sum of divisors is 16.

Constraints

  • Use a loop to find divisors.
  • Do not include the number itself.
MathLoops
JavaScript
Loading...
3 Hidden

Input Arguments

num12

Expected Output

true

Click RUN to test your solution