Abundant Number is a number whose sum of proper factors is greater than the number itself.
Example 1: 18. Sum of proper factors = 1+2+3+6+9 = 21>18. Hence it is an Abundant Number.
Example 2: 14. Sum of proper factors = 1+2+7 = 10<12. Hence it is not an Abundant Number.
Java
import java.util.*;
public class AbundantNumber
{
public static void main(String args[])
{
int n=0,sum=0;
Scanner sc=new Scanner(System.in);
System.out.print("Enter a number: ");
n=sc.nextInt();
for(int i=1;i<n;i++)
{
if(n%i==0)
{
sum=sum+i;
}
}
if(n<sum)
{
System.out.println(n+" is an Abundant Number");
}
else
{
System.out.println(n+" is not an Abundant Number");
}
}
}Java